@pptx-studio/model 0.2.0 → 0.3.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/CHANGELOG.md +33 -0
- package/NOTICE +13 -3
- package/README.md +27 -4
- package/dist/index.d.ts +178 -94
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +590 -10
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @pptx-studio/model
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ae2e566: A table's style is the one PowerPoint draws. `BUILTIN_TABLE_STYLES` is PowerPoint's own Table
|
|
8
|
+
Styles gallery: 74 styles, each with its GUID, its name and the `a:tblStyle` PowerPoint writes for
|
|
9
|
+
it. `tableStyleOf(table)` returns the built-in a table's GUID names, in any case, or `null` for
|
|
10
|
+
PowerPoint's default 1-pt black grid; nothing in `ppt/tableStyles.xml` changes which. `builtinTableStyle`
|
|
11
|
+
and `parseTableStyle` read a `CT_TableStyle` into its thirteen parts. An inline `TableStyleRef` now
|
|
12
|
+
carries its `id`, a style GUID without braces or with padding throws `MODEL_TABLE_ATTR`, and
|
|
13
|
+
`MODEL_ERROR_CODES` lists every code, including the new `MODEL_TABLE_STYLE`.
|
|
14
|
+
|
|
15
|
+
validate adds `V032`, a warning on a table that names no built-in style, and `V033`, refusing the
|
|
16
|
+
table-style forms PowerPoint repairs.
|
|
17
|
+
|
|
18
|
+
## 0.2.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- b58dd19: Built with tsdown 0.23. The declarations take a new shape, and the API is unchanged.
|
|
23
|
+
|
|
24
|
+
- Every value is exported where it is declared (`export declare function …`), not in a trailing
|
|
25
|
+
`export { … }`.
|
|
26
|
+
- The types are exported in one `export type { … }`.
|
|
27
|
+
- The JavaScript is byte-for-byte what 0.22 emitted.
|
|
28
|
+
- In geometry, opc, validate and xml, the source maps name fewer symbols.
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [b58dd19]
|
|
31
|
+
- @pptx-studio/opc@0.1.3
|
|
32
|
+
- @pptx-studio/xml@0.1.2
|
|
33
|
+
- @pptx-studio/geometry@0.1.2
|
|
34
|
+
- @pptx-studio/paint@0.4.1
|
|
35
|
+
|
|
3
36
|
## 0.2.0
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|
package/NOTICE
CHANGED
|
@@ -27,14 +27,24 @@ Entries are added here at the moment the material lands, not at release time.
|
|
|
27
27
|
presetShapeDefinitions.xml, 538970 bytes
|
|
28
28
|
sha256 4a762444d8d85876881c02a5b1dedf6f73006fcd8acb7b4e393435615b37c780
|
|
29
29
|
|
|
30
|
+
* Microsoft PowerPoint output
|
|
31
|
+
Written by Microsoft PowerPoint, driven by this project's own scripts.
|
|
32
|
+
|
|
33
|
+
@pptx-studio/model contains PowerPoint's 74 built-in table styles: each is
|
|
34
|
+
the a:tblStyle element PowerPoint writes into ppt/tableStyles.xml, byte for
|
|
35
|
+
byte, enumerated through PowerPoint's Table Styles gallery and saved by
|
|
36
|
+
PowerPoint (LEGAL.md, ADR 0063). corpus/ground-truth/table-styles.json holds
|
|
37
|
+
the same 74.
|
|
38
|
+
|
|
39
|
+
The decks in corpus/authored are PowerPoint Blank Presentations, so each
|
|
40
|
+
carries the Microsoft-generated ppt/theme/theme1.xml and default layouts
|
|
41
|
+
PowerPoint writes into a new deck (ADR 0009).
|
|
42
|
+
|
|
30
43
|
--------------------------------------------------------------------------------
|
|
31
44
|
Attributions the plan commits us to, listed so the obligation is visible before
|
|
32
45
|
the code arrives
|
|
33
46
|
--------------------------------------------------------------------------------
|
|
34
47
|
|
|
35
|
-
* Pattern fill tiles (sub-phase 2.7) are generated from Mono libgdiplus.
|
|
36
|
-
libgdiplus - Copyright Novell, Inc. and contributors - MIT
|
|
37
|
-
|
|
38
48
|
* Metric-compatible substitute fonts ship in a separate package,
|
|
39
49
|
@pptx-studio/fonts-metric-compat, under SIL OFL 1.1 with its own
|
|
40
50
|
OFL.txt and reserved-font-name handling. They are deliberately kept out
|
package/README.md
CHANGED
|
@@ -171,15 +171,36 @@ built to disagree with themselves:
|
|
|
171
171
|
a column is never narrower than its cells' side margins plus 2 pt; and the frame's `a:ext` says
|
|
172
172
|
nothing about the drawn size, which is the grid's sums (76/76 against 62/76).
|
|
173
173
|
|
|
174
|
-
Cell text is a `TextBody` like any other.
|
|
175
|
-
|
|
174
|
+
Cell text is a `TextBody` like any other.
|
|
175
|
+
|
|
176
|
+
## A table draws the built-in its GUID names, or none
|
|
177
|
+
|
|
178
|
+
`BUILTIN_TABLE_STYLES` is PowerPoint's own Table Styles gallery: the 74 styles, in gallery order,
|
|
179
|
+
each with its GUID, its name and the `a:tblStyle` PowerPoint writes for it, byte for byte. They were
|
|
180
|
+
enumerated by driving the gallery itself and read back as PowerPoint serialised them (C8,
|
|
181
|
+
`corpus/ground-truth/table-styles.json`); nothing was transcribed from another implementation.
|
|
182
|
+
|
|
183
|
+
`tableStyleOf(table)` is the style PowerPoint draws a table with, and C8 found one rule for it
|
|
184
|
+
across 84 packages in three themes:
|
|
185
|
+
|
|
186
|
+
- The `a:tableStyleId` - or an inline `a:tableStyle`'s `@styleId` - names one of the 74, in any
|
|
187
|
+
case, and that built-in is drawn (230/230 across every style in two themes).
|
|
188
|
+
- Nothing in `ppt/tableStyles.xml` changes the drawing: a redefined built-in draws PowerPoint's own
|
|
189
|
+
(7/7), a custom style defined there draws nothing of itself, and `@def` is never applied.
|
|
190
|
+
- Any other id, or none, returns `null`: PowerPoint draws a 1-pt black grid with no fill, whatever
|
|
191
|
+
the theme (3/3 against the theme's `dk1` and `tx1`).
|
|
192
|
+
|
|
193
|
+
`builtinTableStyle(id)` parses one of the 74 afresh; `parseTableStyle` reads any `CT_TableStyle`,
|
|
194
|
+
defaulting nothing the file did not say. A GUID without braces or with padding, an edge with neither
|
|
195
|
+
`a:ln` nor `a:lnRef`, and an empty `a:fill` throw: PowerPoint repairs each. The thirteen-part
|
|
196
|
+
cascade is 4.3; drawing the grid is 4.4.
|
|
176
197
|
|
|
177
198
|
## What is not here
|
|
178
199
|
|
|
179
200
|
- Nothing is painted. The renderers are 2.10.
|
|
180
201
|
- The ten-source **text** cascade is 3.1. `Origin` already declares the five members only that
|
|
181
202
|
cascade can produce, so 3.1 adds cases rather than widening a type every consumer has switched on.
|
|
182
|
-
-
|
|
203
|
+
- The table-style cascade and table drawing are 4.3 and 4.4; SmartArt is 4.5.
|
|
183
204
|
- Commands, undo and history are Phase 5; Change Layout is 7.4. What PowerPoint rewrites when a
|
|
184
205
|
layout changes is recorded in the fixture and not acted on.
|
|
185
206
|
- `a:effectDag` is not modelled — a directed graph of effect primitives PowerPoint has never been
|
|
@@ -190,6 +211,7 @@ thirteen-part cascade is 4.3; drawing the grid is 4.4.
|
|
|
190
211
|
|
|
191
212
|
`corpus/ground-truth/sheets.json` — 114 probes in 37 packages, sub-phase 2.9.
|
|
192
213
|
`corpus/ground-truth/tables.json` — 82 tables, one package each, and 21 slides PowerPoint authored, sub-phase 4.1.
|
|
214
|
+
`corpus/ground-truth/table-styles.json` — the 74 built-in table styles and 84 probe packages, sub-phase 4.2.
|
|
193
215
|
|
|
194
216
|
The measurement is a **position**, and PowerPoint reports it directly. C3 and C4 sampled bitmaps
|
|
195
217
|
because a fill and a stroke are pictures; an inheritance is not. A placeholder with no `a:xfrm` of
|
|
@@ -205,4 +227,5 @@ against a summary of them, so a rule that drifts fails on the measurements.
|
|
|
205
227
|
|
|
206
228
|
See `docs/adr/phase-0-foundation/0007-ground-truth.md`, `docs/adr/phase-2-geometry-and-paint/0021-colour.md`, `docs/adr/phase-2-geometry-and-paint/0022-fills.md`,
|
|
207
229
|
`docs/adr/phase-2-geometry-and-paint/0023-lines.md`, `docs/adr/phase-2-geometry-and-paint/0024-model-parse-and-resolve.md`
|
|
208
|
-
|
|
230
|
+
`docs/adr/phase-4-tables-and-smartart/0056-the-spans-are-the-merge.md` and
|
|
231
|
+
`docs/adr/phase-4-tables-and-smartart/0063-a-table-draws-the-built-in-its-guid-names.md`.
|