@pptx-studio/model 0.1.4 → 0.2.1
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 +39 -0
- package/README.md +26 -1
- package/dist/index.d.ts +206 -87
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +291 -61
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @pptx-studio/model
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b58dd19: Built with tsdown 0.23. The declarations take a new shape, and the API is unchanged.
|
|
8
|
+
|
|
9
|
+
- Every value is exported where it is declared (`export declare function …`), not in a trailing
|
|
10
|
+
`export { … }`.
|
|
11
|
+
- The types are exported in one `export type { … }`.
|
|
12
|
+
- The JavaScript is byte-for-byte what 0.22 emitted.
|
|
13
|
+
- In geometry, opc, validate and xml, the source maps name fewer symbols.
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [b58dd19]
|
|
16
|
+
- @pptx-studio/opc@0.1.3
|
|
17
|
+
- @pptx-studio/xml@0.1.2
|
|
18
|
+
- @pptx-studio/geometry@0.1.2
|
|
19
|
+
- @pptx-studio/paint@0.4.1
|
|
20
|
+
|
|
21
|
+
## 0.2.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- e8ba475: A table is parsed, and its grid is the one PowerPoint draws.
|
|
26
|
+
|
|
27
|
+
`Shape.table` carries the `a:tbl` of a `p:graphicFrame`: the `a:tblPr` flags and style source, every
|
|
28
|
+
`a:gridCol`, every `a:tr` with its cells, and each cell's spans, body and `a:tcPr` as written.
|
|
29
|
+
`tableGrid` resolves the merges by the rule C7 measured (`tables.json`, 76 of 76 tables PowerPoint
|
|
30
|
+
opened as written and 21 it authored itself): each `a:tc` takes the next column, the spans on the
|
|
31
|
+
anchor are the whole story, a covered position is covered whatever its own attributes say, a span
|
|
32
|
+
stops at the edge or at the first claimed position, and `hMerge`/`vMerge` change nothing. `a:tr/@h`
|
|
33
|
+
is a minimum, a column is never narrower than its cells' side margins plus 2 pt, and the frame's
|
|
34
|
+
`a:ext` says nothing about the drawn size. A table attribute of the wrong type throws
|
|
35
|
+
`MODEL_TABLE_ATTR`.
|
|
36
|
+
|
|
37
|
+
`@pptx-studio/validate` gains `V030`, a warning on a table whose rows, spans and flags disagree —
|
|
38
|
+
PowerPoint opens it silently and rewrites it on the next save — and `V031`, fatal on the missing or
|
|
39
|
+
mistyped table attributes PowerPoint repairs. The downstream packages carry the new rules and the
|
|
40
|
+
new field; nothing they draw changes.
|
|
41
|
+
|
|
3
42
|
## 0.1.4
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -152,11 +152,34 @@ Geometry is not special. Fills, lines, effects and `p:style` all travel the same
|
|
|
152
152
|
were measured arriving from the layout placeholder and from the master placeholder through a layout
|
|
153
153
|
that declared nothing.
|
|
154
154
|
|
|
155
|
+
## A table is its grid, and the spans are the whole of a merge
|
|
156
|
+
|
|
157
|
+
A `p:graphicFrame` whose `a:graphicData` is a table carries `shape.table`: the `a:tblPr` flags and
|
|
158
|
+
style source, every `a:gridCol`, every `a:tr` with its cells, and each cell's spans (absent reads
|
|
159
|
+
as 1), flags (absent reads as false), body and `a:tcPr`. `tableGrid(table)` is what PowerPoint draws
|
|
160
|
+
from it, and the rule was measured in C7 (`corpus/ground-truth/tables.json`) on 82 tables, 52 of them
|
|
161
|
+
built to disagree with themselves:
|
|
162
|
+
|
|
163
|
+
- Each `a:tc` takes the next column. A short row is padded with empty positions; a fifth cell in a
|
|
164
|
+
four-column grid is dropped.
|
|
165
|
+
- `gridSpan` and `rowSpan` on the anchor are the whole story, 76 of 76. A position an earlier span
|
|
166
|
+
claimed is covered whatever its own attributes say; a span stops at the grid edge or at the
|
|
167
|
+
first claimed position; zero is one and a negative runs to the edge.
|
|
168
|
+
- `hMerge` and `vMerge` change nothing. The flags-only reading a person writes first fits 52 of 76,
|
|
169
|
+
and PowerPoint rewrites the flags from the spans on save.
|
|
170
|
+
- `a:tr/@h` is the least a row is drawn at, never the most (72/72 against 68/72 for a fixed height);
|
|
171
|
+
a column is never narrower than its cells' side margins plus 2 pt; and the frame's `a:ext` says
|
|
172
|
+
nothing about the drawn size, which is the grid's sums (76/76 against 62/76).
|
|
173
|
+
|
|
174
|
+
Cell text is a `TextBody` like any other. The table style a `tableStyleId` names is 4.2; the
|
|
175
|
+
thirteen-part cascade is 4.3; drawing the grid is 4.4.
|
|
176
|
+
|
|
155
177
|
## What is not here
|
|
156
178
|
|
|
157
179
|
- Nothing is painted. The renderers are 2.10.
|
|
158
180
|
- The ten-source **text** cascade is 3.1. `Origin` already declares the five members only that
|
|
159
181
|
cascade can produce, so 3.1 adds cases rather than widening a type every consumer has switched on.
|
|
182
|
+
- Table styles, their cascade and their drawing are 4.2 to 4.4; SmartArt is 4.5.
|
|
160
183
|
- Commands, undo and history are Phase 5; Change Layout is 7.4. What PowerPoint rewrites when a
|
|
161
184
|
layout changes is recorded in the fixture and not acted on.
|
|
162
185
|
- `a:effectDag` is not modelled — a directed graph of effect primitives PowerPoint has never been
|
|
@@ -166,6 +189,7 @@ that declared nothing.
|
|
|
166
189
|
## Fixtures
|
|
167
190
|
|
|
168
191
|
`corpus/ground-truth/sheets.json` — 114 probes in 37 packages, sub-phase 2.9.
|
|
192
|
+
`corpus/ground-truth/tables.json` — 82 tables, one package each, and 21 slides PowerPoint authored, sub-phase 4.1.
|
|
169
193
|
|
|
170
194
|
The measurement is a **position**, and PowerPoint reports it directly. C3 and C4 sampled bitmaps
|
|
171
195
|
because a fill and a stroke are pictures; an inheritance is not. A placeholder with no `a:xfrm` of
|
|
@@ -180,4 +204,5 @@ parent it matched — one number, no fitting, no error bars.
|
|
|
180
204
|
against a summary of them, so a rule that drifts fails on the measurements.
|
|
181
205
|
|
|
182
206
|
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`,
|
|
183
|
-
`docs/adr/phase-2-geometry-and-paint/0023-lines.md
|
|
207
|
+
`docs/adr/phase-2-geometry-and-paint/0023-lines.md`, `docs/adr/phase-2-geometry-and-paint/0024-model-parse-and-resolve.md`
|
|
208
|
+
and `docs/adr/phase-4-tables-and-smartart/0056-the-spans-are-the-merge.md`.
|