pptx-ts 4.0.1 → 4.1.1-next.100.g96a3845
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/README.md +147 -114
- package/dist/anim-presets-CF4p8mnd.js +56 -0
- package/dist/anim-presets-CF4p8mnd.js.map +1 -0
- package/dist/{autopage-odPz7zZO.js → autopage-8Pwh-jsI.js} +5 -5
- package/dist/{autopage-odPz7zZO.js.map → autopage-8Pwh-jsI.js.map} +1 -1
- package/dist/{body-insets-Dw_BeWD_.js → body-insets-CRTz4dbM.js} +2 -2
- package/dist/{body-insets-Dw_BeWD_.js.map → body-insets-CRTz4dbM.js.map} +1 -1
- package/dist/browser.d.ts +14 -10
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +11 -9
- package/dist/browser.js.map +1 -1
- package/dist/{image-size-CvN2iCA4.js → chart-metadata-BC-SkQlO.js} +568 -459
- package/dist/chart-metadata-BC-SkQlO.js.map +1 -0
- package/dist/{clip-Bl01BPcN.d.ts → clip-BajRBqRR.d.ts} +2 -2
- package/dist/{clip-Bl01BPcN.d.ts.map → clip-BajRBqRR.d.ts.map} +1 -1
- package/dist/{notes-Dh12JAbn.js → comments-CXwp71GL.js} +397 -250
- package/dist/comments-CXwp71GL.js.map +1 -0
- package/dist/{diagnostics-D8ot4Ei7.d.ts → diagnostics-KFkofYBc.d.ts} +39 -29
- package/dist/diagnostics-KFkofYBc.d.ts.map +1 -0
- package/dist/{embedded-fonts-DarT9aoa.d.ts → embedded-fonts-Bzyulsbl.d.ts} +2 -2
- package/dist/{embedded-fonts-DarT9aoa.d.ts.map → embedded-fonts-Bzyulsbl.d.ts.map} +1 -1
- package/dist/{entry-compose-DCnvBZz2.d.ts → entry-compose-BOzZ9J5K.d.ts} +23 -21
- package/dist/entry-compose-BOzZ9J5K.d.ts.map +1 -0
- package/dist/{errors-C4oENPcu.js → entry-errors-BRMlRV9p.js} +34 -15
- package/dist/entry-errors-BRMlRV9p.js.map +1 -0
- package/dist/{table-cell-margins-EVg0EwxT.js → enums-BwXKwMmg.js} +25 -25
- package/dist/enums-BwXKwMmg.js.map +1 -0
- package/dist/{enums-BUKTUB6V.d.ts → enums-DQRpVOLh.d.ts} +3 -3
- package/dist/{enums-BUKTUB6V.d.ts.map → enums-DQRpVOLh.d.ts.map} +1 -1
- package/dist/families.d.ts +6 -6
- package/dist/families.d.ts.map +1 -1
- package/dist/families.js +2 -2
- package/dist/{fit-Cb7naFj6.js → fit-vz5JxCtc.js} +28 -11
- package/dist/{fit-Cb7naFj6.js.map → fit-vz5JxCtc.js.map} +1 -1
- package/dist/{font-metrics-v5fn7s7e.d.ts → font-metrics-CvghMPmL.d.ts} +36 -8
- package/dist/font-metrics-CvghMPmL.d.ts.map +1 -0
- package/dist/{grid-DikTjFey.js → grid-BPkvmUH2.js} +18 -19
- package/dist/grid-BPkvmUH2.js.map +1 -0
- package/dist/{html-dom-Iuog2wdK.js → html-dom-CQxFKgze.js} +10 -10
- package/dist/html-dom-CQxFKgze.js.map +1 -0
- package/dist/html.d.ts +4 -4
- package/dist/html.js +7 -7
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +13 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +5 -5
- package/dist/inspect.js +5 -5
- package/dist/inspect.js.map +1 -1
- package/dist/{text-anchor-CrYXAfUu.js → lock-attrs-Bm6h1gdn.js} +56 -3
- package/dist/lock-attrs-Bm6h1gdn.js.map +1 -0
- package/dist/math.d.ts +2 -2
- package/dist/math.js +2 -2
- package/dist/measure.d.ts +4 -4
- package/dist/measure.js +3 -3
- package/dist/node.d.ts +13 -9
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +8 -6
- package/dist/node.js.map +1 -1
- package/dist/options-internal-WqgMf720.js.map +1 -1
- package/dist/{package-J49Ck6S2.d.ts → package-KoEgVwII.d.ts} +6 -2
- package/dist/{package-J49Ck6S2.d.ts.map → package-KoEgVwII.d.ts.map} +1 -1
- package/dist/{pres-C6qgOFAa.d.ts → pres-3fR4qGHf.d.ts} +255 -67
- package/dist/pres-3fR4qGHf.d.ts.map +1 -0
- package/dist/{presentation-DGYlAWhl.js → presentation-C6-AaVOe.js} +243 -67
- package/dist/presentation-C6-AaVOe.js.map +1 -0
- package/dist/{presentation-types-8jLQHI4M.d.ts → presentation-types-Q77szHWz.d.ts} +762 -65
- package/dist/presentation-types-Q77szHWz.d.ts.map +1 -0
- package/dist/read.d.ts +7 -7
- package/dist/read.js +4 -4
- package/dist/script.d.ts +59 -12
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +2475 -541
- package/dist/script.js.map +1 -1
- package/dist/{shapes-re0KyQk_.js → shapes-CnR9BbfQ.js} +1201 -153
- package/dist/shapes-CnR9BbfQ.js.map +1 -0
- package/dist/{slide-Dx2ZeVZ6.d.ts → slide-C4I0dA2b.d.ts} +39 -14
- package/dist/slide-C4I0dA2b.d.ts.map +1 -0
- package/dist/{table-dom-BTDP3lEP.js → table-dom-B2QpmHh-.js} +3 -3
- package/dist/{table-dom-BTDP3lEP.js.map → table-dom-B2QpmHh-.js.map} +1 -1
- package/dist/{text-sN64Otf_.js → text-DARib7Qq.js} +266 -161
- package/dist/text-DARib7Qq.js.map +1 -0
- package/dist/{units-internal-XJlf-hOl.js → units-internal-CKHeSXX2.js} +11 -6
- package/dist/units-internal-CKHeSXX2.js.map +1 -0
- package/dist/{zip-C0leZZMj.d.ts → zip-CTll_dr0.d.ts} +2 -2
- package/dist/{zip-C0leZZMj.d.ts.map → zip-CTll_dr0.d.ts.map} +1 -1
- package/dist/{zip-CKd8ihcf.js → zip-Mtv-eFTc.js} +2 -2
- package/dist/{zip-CKd8ihcf.js.map → zip-Mtv-eFTc.js.map} +1 -1
- package/dist/zip.d.ts +3 -3
- package/dist/zip.js +3 -3
- package/dist/{zoom-DPUHh85d.js → zoom-CHCsn5_9.js} +422 -267
- package/dist/zoom-CHCsn5_9.js.map +1 -0
- package/package.json +42 -33
- package/skills/{ts-pptx-upstream → pptx-ts-upstream}/SKILL.md +25 -25
- package/dist/diagnostics-D8ot4Ei7.d.ts.map +0 -1
- package/dist/entry-compose-DCnvBZz2.d.ts.map +0 -1
- package/dist/errors-C4oENPcu.js.map +0 -1
- package/dist/font-metrics-v5fn7s7e.d.ts.map +0 -1
- package/dist/grid-DikTjFey.js.map +0 -1
- package/dist/html-dom-Iuog2wdK.js.map +0 -1
- package/dist/image-size-CvN2iCA4.js.map +0 -1
- package/dist/notes-Dh12JAbn.js.map +0 -1
- package/dist/pres-C6qgOFAa.d.ts.map +0 -1
- package/dist/presentation-DGYlAWhl.js.map +0 -1
- package/dist/presentation-types-8jLQHI4M.d.ts.map +0 -1
- package/dist/shapes-re0KyQk_.js.map +0 -1
- package/dist/slide-Dx2ZeVZ6.d.ts.map +0 -1
- package/dist/table-cell-margins-EVg0EwxT.js.map +0 -1
- package/dist/text-anchor-CrYXAfUu.js.map +0 -1
- package/dist/text-sN64Otf_.js.map +0 -1
- package/dist/units-internal-XJlf-hOl.js.map +0 -1
- package/dist/zoom-DPUHh85d.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,102 +1,147 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[](LICENSE)
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/readme/banner/banner-dark.svg">
|
|
5
|
+
<img alt="pptx-ts: write a program, get a PowerPoint file" src="assets/readme/banner/banner-light.svg">
|
|
6
|
+
</picture>
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
[![npm][npm-badge]][npm]
|
|
9
|
+
[![Downloads][downloads-badge]][npm]
|
|
10
|
+
[![CI][ci-badge]][ci]
|
|
11
|
+
[![License][license-badge]][license]
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
slides in TypeScript and a `.pptx` comes out the other end. PowerPoint never runs, no
|
|
13
|
-
Office licence is involved, and nothing has to be installed on the machine doing the
|
|
14
|
-
writing. The file opens cleanly in desktop PowerPoint, and Keynote, LibreOffice Impress
|
|
15
|
-
and Google Slides import it on a best-effort basis.
|
|
13
|
+
---
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
one deck per customer, a hundred decks per night, or a download button on a page that
|
|
19
|
-
hands the user a deck built from what they are looking at.
|
|
15
|
+
[Quickstart](#quickstart) • [Read and edit](#read-and-edit-decks-too) • [Compare](#how-this-compares-with-pptxgenjs) • [Docs](https://shbernal.github.io/pptx-ts/)
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
---
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
pnpm add pptx-ts
|
|
25
|
-
```
|
|
19
|
+
</div>
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
<p align="center">
|
|
22
|
+
<picture>
|
|
23
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/readme/demo/demo-dark.svg">
|
|
24
|
+
<img alt="A 28-line TypeScript program runs and writes report.pptx, a slide with a revenue bar chart" src="assets/readme/demo/demo-light.svg">
|
|
25
|
+
</picture>
|
|
26
|
+
</p>
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
pptx-ts writes `.pptx` files from TypeScript.
|
|
29
|
+
You describe slides in code, and a deck comes out that opens cleanly in desktop PowerPoint.
|
|
30
|
+
PowerPoint never runs, so there is no Office licence and nothing to install on the machine doing the writing.
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
- Text, tables that page across slides, shapes, connectors, pictures, SVG, video and audio.
|
|
33
|
+
- Native charts backed by an embedded workbook, so PowerPoint's "Edit Data" works.
|
|
34
|
+
- Slide masters, layouts, sections, speaker notes, gradients and an image clipped to a shape.
|
|
35
|
+
- LaTeX maths, embedded spreadsheets and 3D models.
|
|
36
|
+
- [An HTML `<table>` becomes paged slides](docs/html-tables.md), in the browser or under Node.
|
|
37
|
+
- [Text measured against the real font](docs/text-fit.md), so a box shrinks or grows to fit before the file is written.
|
|
38
|
+
- Opens existing decks too: [inspect](docs/reference/pptx-inspection.md), [edit](docs/reading/read-and-edit.md), or [turn one into code](docs/reference/pptx-to-script.md).
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
<p align="center">
|
|
41
|
+
<img alt="Nine slides from the two showcase decks: a consulting cover, a cost waterfall, a dark pitch-deck cover over a night sky, KPI cards, a pipeline diagram with connectors, a business-case table with Harvey balls, a terminal mock, a 2x2 prioritisation matrix and an area chart" src="assets/readme/gallery/gallery.webp">
|
|
42
|
+
</p>
|
|
38
43
|
|
|
39
|
-
slide
|
|
40
|
-
|
|
41
|
-
y: 1,
|
|
42
|
-
w: 8,
|
|
43
|
-
h: 1,
|
|
44
|
-
fontSize: 24,
|
|
45
|
-
color: "363636",
|
|
46
|
-
})
|
|
44
|
+
pptx-ts wrote every slide above, and LibreOffice rendered them.
|
|
45
|
+
They come from the two [showcase decks](www/demos/decks/README.md).
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
## Why pptx-ts?
|
|
48
|
+
|
|
49
|
+
Use it when a deck has to be built from data that changes:
|
|
50
|
+
|
|
51
|
+
- a monthly report
|
|
52
|
+
- one deck per customer
|
|
53
|
+
- a hundred decks every night
|
|
54
|
+
- a download button that hands the user a deck built from what they are looking at
|
|
55
|
+
|
|
56
|
+
Every deck has to open cleanly in desktop PowerPoint.
|
|
57
|
+
Keynote, LibreOffice Impress and Google Slides import it on a best-effort basis.
|
|
58
|
+
|
|
59
|
+
## Quickstart
|
|
60
|
+
|
|
61
|
+
1. Install pptx-ts on your project:
|
|
62
|
+
|
|
63
|
+
[![Node ≥ 24][node-badge]][node]
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pnpm add pptx-ts
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
2. Save this as `hello.mts`:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import PptxTs from "pptx-ts"
|
|
73
|
+
|
|
74
|
+
const pptx = new PptxTs()
|
|
75
|
+
const slide = pptx.addSlide()
|
|
76
|
+
|
|
77
|
+
slide.addText("Hello from pptx-ts", {
|
|
78
|
+
x: 1,
|
|
79
|
+
y: 1,
|
|
80
|
+
w: 8,
|
|
81
|
+
h: 1,
|
|
82
|
+
fontSize: 24,
|
|
83
|
+
color: "363636",
|
|
84
|
+
})
|
|
50
85
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
in from the top-left corner of a 10 by 5.625 inch slide.
|
|
54
|
-
[Your first deck](docs/getting-started/first-deck.md) builds a bigger one from data, with a
|
|
55
|
-
table, a chart and speaker notes.
|
|
86
|
+
await pptx.writeFile({ fileName: "hello.pptx" })
|
|
87
|
+
```
|
|
56
88
|
|
|
57
|
-
|
|
89
|
+
3. Run it. Node 24 strips the types itself, so there is no build step.
|
|
58
90
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
PowerPoint opens its data the way it does for a chart a human made. Speaker notes,
|
|
63
|
-
sections, slide masters and layouts, gradients, an image clipped to a shape, a
|
|
64
|
-
spreadsheet embedded as an object, a 3D model, and LaTeX maths.
|
|
91
|
+
```bash
|
|
92
|
+
node hello.mts
|
|
93
|
+
```
|
|
65
94
|
|
|
66
|
-
|
|
95
|
+
4. Open `hello.pptx`.
|
|
67
96
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
slides. Works in a browser and under Node.
|
|
71
|
-
- **[Text that has to fit](docs/text-fit.md).** ts-pptx can measure the text
|
|
72
|
-
against the real font and shrink or grow the box before it writes the file, instead
|
|
73
|
-
of leaving you to guess at font sizes.
|
|
97
|
+
Positions are in inches, from the top-left corner of a 10 by 5.625 inch slide.
|
|
98
|
+
[Your first deck](docs/getting-started/first-deck.md) builds a four-slide report from an array, with a table, a chart and speaker notes.
|
|
74
99
|
|
|
75
|
-
##
|
|
100
|
+
## Read and edit decks too
|
|
76
101
|
|
|
77
|
-
|
|
78
|
-
|
|
102
|
+
PptxGenJS, the library pptx-ts descends from, only writes.
|
|
103
|
+
pptx-ts also opens a `.pptx` you already have.
|
|
79
104
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
get TypeScript that rebuilds it. Anything it could not express is reported to you
|
|
86
|
-
rather than dropped in silence. It is the fastest way to learn the API: build a
|
|
87
|
-
slide by hand in PowerPoint, then read the script for it.
|
|
105
|
+
| Entry point | What it does |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `pptx-ts/inspect` | Slide count, size, parts, media and fonts, without loading the whole deck. [Guide](docs/reference/pptx-inspection.md) |
|
|
108
|
+
| `pptx-ts/read` | Open a deck, change the text on slide four, save it. Parts you did not touch keep their original bytes. [Guide](docs/reading/read-and-edit.md) |
|
|
109
|
+
| `pptx-ts/script` | Print TypeScript that rebuilds a deck, plus a note for each construct it could not carry. [Guide](docs/reference/pptx-to-script.md) |
|
|
88
110
|
|
|
89
|
-
|
|
111
|
+
```ts
|
|
112
|
+
import { readFile, writeFile } from "node:fs/promises"
|
|
113
|
+
import { Presentation } from "pptx-ts/read"
|
|
114
|
+
|
|
115
|
+
const deck = await Presentation.load(await readFile("report.pptx"))
|
|
116
|
+
const title = deck.slides[0]?.placeholder("title")
|
|
117
|
+
if (title) title.text = "Q3 review"
|
|
118
|
+
|
|
119
|
+
await writeFile("report.pptx", await deck.save())
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The script printer is the quickest way to learn the API.
|
|
123
|
+
Build a slide by hand in PowerPoint, then read the code for it.
|
|
124
|
+
|
|
125
|
+
## How it works
|
|
126
|
+
|
|
127
|
+
<p align="center">
|
|
128
|
+
<picture>
|
|
129
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/readme/how-it-works/loop-dark.svg">
|
|
130
|
+
<img alt="pptx-ts writes a .pptx from your code; pptx-ts/read loads and saves it, pptx-ts/inspect lists its contents, and pptx-ts/script turns it back into TypeScript" src="assets/readme/how-it-works/loop-light.svg">
|
|
131
|
+
</picture>
|
|
132
|
+
</p>
|
|
90
133
|
|
|
91
|
-
|
|
134
|
+
A `.pptx` is a zip of XML parts.
|
|
135
|
+
pptx-ts builds those parts from your calls and zips them, with no Office process involved.
|
|
136
|
+
|
|
137
|
+
| Runtime | Import | `writeFile` |
|
|
92
138
|
| --- | --- | --- |
|
|
93
139
|
| Node.js 24 or later | `import`, or `require()` with the class on `.default` | writes to disk |
|
|
94
|
-
|
|
|
95
|
-
|
|
|
140
|
+
| Browser, with a bundler | `import` | downloads the file |
|
|
141
|
+
| Browser, no build step | `import PptxTs from "https://esm.sh/pptx-ts/browser"` | downloads the file |
|
|
96
142
|
| Deno, Bun, edge workers | `import` | throws; use `toBytes()` |
|
|
97
143
|
|
|
98
|
-
[Where it runs](docs/getting-started/runtime.md) lists every entry point
|
|
99
|
-
loads the one ESM build.
|
|
144
|
+
[Where it runs](docs/getting-started/runtime.md) lists every entry point.
|
|
100
145
|
|
|
101
146
|
<!-- comparison:start -->
|
|
102
147
|
<!-- GENERATED REGION. Do not edit by hand.
|
|
@@ -105,20 +150,20 @@ loads the one ESM build.
|
|
|
105
150
|
|
|
106
151
|
## How this compares with PptxGenJS
|
|
107
152
|
|
|
108
|
-
ts
|
|
153
|
+
pptx-ts is an independent derivative of
|
|
109
154
|
[PptxGenJS](https://github.com/gitbrent/PptxGenJS), detached at its v4.0.1. Both were
|
|
110
|
-
measured on 2026-
|
|
155
|
+
measured on 2026-10-11 by building the same 22 deck intents with each library and reading
|
|
111
156
|
the bytes that came out.
|
|
112
157
|
|
|
113
|
-
- **Construct coverage:** ts
|
|
114
|
-
corpus is emitted by pptxgenjs and not by ts
|
|
115
|
-
- **Schema validity:** of the decks each library built, 21 of 21 ts
|
|
158
|
+
- **Construct coverage:** pptx-ts emitted 21 of 22, pptxgenjs 10 of 22. Nothing in the
|
|
159
|
+
corpus is emitted by pptxgenjs and not by pptx-ts.
|
|
160
|
+
- **Schema validity:** of the decks each library built, 21 of 21 pptx-ts decks and 0 of 10
|
|
116
161
|
pptxgenjs decks validate with no error against the Open XML SDK.
|
|
117
|
-
- **Adoption:** pptxgenjs is downloaded
|
|
118
|
-
ts
|
|
162
|
+
- **Adoption:** pptxgenjs is downloaded 14,641,405 times a month, against 1,915 for
|
|
163
|
+
pptx-ts. If a large installed base matters to you more than the differences above, use
|
|
119
164
|
pptxgenjs.
|
|
120
|
-
- **Activity:** last commit on the default branch, 2026-
|
|
121
|
-
for pptxgenjs. Last npm publish, 2026-
|
|
165
|
+
- **Activity:** last commit on the default branch, 2026-10-10 for pptx-ts and 2025-06-26
|
|
166
|
+
for pptxgenjs. Last npm publish, 2026-09-21 and 2025-06-26.
|
|
122
167
|
|
|
123
168
|
Where the two libraries part company is on the [comparison page](docs/comparison.md), and
|
|
124
169
|
[how it was measured](docs/comparison-method.md) has every full table. Every intent as
|
|
@@ -127,40 +172,28 @@ PptxGenJS](docs/comparison-syntax.md).
|
|
|
127
172
|
|
|
128
173
|
<!-- comparison:end -->
|
|
129
174
|
|
|
130
|
-
##
|
|
131
|
-
|
|
132
|
-
The documentation site, with the generated API reference, is at
|
|
133
|
-
**<https://shbernal.github.io/ts-pptx/>**. The [demos page](https://shbernal.github.io/ts-pptx/demos)
|
|
134
|
-
builds a quarterly review deck in your browser and previews the slides.
|
|
135
|
-
|
|
136
|
-
- Start with the [Introduction](docs/getting-started/introduction.md),
|
|
137
|
-
[Your first deck](docs/getting-started/first-deck.md) and
|
|
138
|
-
[Core concepts](docs/getting-started/concepts.md)
|
|
139
|
-
- [Tables](docs/tables.md), [connectors](docs/connectors.md), [groups](docs/groups.md) and
|
|
140
|
-
[HTML tables to slides](docs/html-tables.md)
|
|
141
|
-
- [Smaller bundles](docs/bundle-size.md) for a browser program that composes only what it uses
|
|
142
|
-
- [Errors and warnings](docs/errors-and-warnings.md) and
|
|
143
|
-
[troubleshooting](docs/troubleshooting.md)
|
|
144
|
-
|
|
145
|
-
## Something wrong, or missing?
|
|
175
|
+
## Learn more
|
|
146
176
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
reproduction, instead of a silent workaround:
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
npx skills add ./node_modules/pptx-ts -s '*' -a claude-code -a codex -a universal -y
|
|
156
|
-
```
|
|
177
|
+
- [Documentation site](https://shbernal.github.io/pptx-ts/), with the API reference
|
|
178
|
+
- [Live demo](https://shbernal.github.io/pptx-ts/demos): build a strategy consulting deck and a startup pitch deck in your browser
|
|
179
|
+
- [Core concepts](docs/getting-started/concepts.md), [tables](docs/tables.md), [connectors](docs/connectors.md) and [groups](docs/groups.md)
|
|
180
|
+
- [Smaller browser bundles](docs/bundle-size.md)
|
|
181
|
+
- [Errors and warnings](docs/errors-and-warnings.md) and [troubleshooting](docs/troubleshooting.md)
|
|
157
182
|
|
|
158
|
-
|
|
159
|
-
|
|
183
|
+
Found a bug? [Open an issue](https://github.com/shbernal/pptx-ts/issues).
|
|
184
|
+
Errors that are the library's fault print that link themselves.
|
|
160
185
|
|
|
161
|
-
|
|
186
|
+
If an agent writes most of your code, install the `pptx-ts-upstream` skill that ships in the package.
|
|
187
|
+
It files a library defect the agent hits as an issue with a small reproduction, instead of a silent workaround.
|
|
188
|
+
[CONTRIBUTING.md](CONTRIBUTING.md#the-skill-that-files-the-issue-for-you) has the install command.
|
|
162
189
|
|
|
163
|
-
Copyright (c) 2015-2022 Brent Ely.
|
|
164
|
-
Modifications copyright (c) 2026 shbernal.
|
|
165
190
|
|
|
166
|
-
[
|
|
191
|
+
[npm]: https://www.npmjs.com/package/pptx-ts
|
|
192
|
+
[npm-badge]: https://img.shields.io/npm/v/pptx-ts?style=for-the-badge&logo=npm&logoColor=e9855c&label=npm&labelColor=1b1b1f&color=b4451f
|
|
193
|
+
[downloads-badge]: https://img.shields.io/npm/dm/pptx-ts?style=for-the-badge&label=downloads&labelColor=1b1b1f&color=b4451f
|
|
194
|
+
[ci]: https://github.com/shbernal/pptx-ts/actions/workflows/ci.yml
|
|
195
|
+
[ci-badge]: https://img.shields.io/github/actions/workflow/status/shbernal/pptx-ts/ci.yml?branch=main&style=for-the-badge&logo=githubactions&logoColor=e9855c&label=CI&labelColor=1b1b1f&color=b4451f
|
|
196
|
+
[node]: package.json
|
|
197
|
+
[node-badge]: https://img.shields.io/badge/node-%E2%89%A524-b4451f?style=for-the-badge&logo=nodedotjs&logoColor=e9855c&labelColor=1b1b1f
|
|
198
|
+
[license]: LICENSE
|
|
199
|
+
[license-badge]: https://img.shields.io/github/license/shbernal/pptx-ts?style=for-the-badge&labelColor=1b1b1f&color=b4451f
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region src/ooxml/anim-presets.ts
|
|
2
|
+
/** Every preset `addAnimation` writes. `satisfies` makes a preset added without a row a compile error. */
|
|
3
|
+
const ANIM_PRESET_IDENTITY = {
|
|
4
|
+
fadeIn: {
|
|
5
|
+
presetID: 10,
|
|
6
|
+
presetClass: "entr",
|
|
7
|
+
presetSubtype: 0,
|
|
8
|
+
defaultDurationMs: 500
|
|
9
|
+
},
|
|
10
|
+
flyIn: {
|
|
11
|
+
presetID: 2,
|
|
12
|
+
presetClass: "entr",
|
|
13
|
+
presetSubtype: 4,
|
|
14
|
+
defaultDurationMs: 500
|
|
15
|
+
},
|
|
16
|
+
appear: {
|
|
17
|
+
presetID: 1,
|
|
18
|
+
presetClass: "entr",
|
|
19
|
+
presetSubtype: 0,
|
|
20
|
+
defaultDurationMs: 500
|
|
21
|
+
},
|
|
22
|
+
wipe: {
|
|
23
|
+
presetID: 22,
|
|
24
|
+
presetClass: "entr",
|
|
25
|
+
presetSubtype: 4,
|
|
26
|
+
defaultDurationMs: 500
|
|
27
|
+
},
|
|
28
|
+
grow: {
|
|
29
|
+
presetID: 6,
|
|
30
|
+
presetClass: "emph",
|
|
31
|
+
presetSubtype: 0,
|
|
32
|
+
defaultDurationMs: 2e3
|
|
33
|
+
},
|
|
34
|
+
spin: {
|
|
35
|
+
presetID: 8,
|
|
36
|
+
presetClass: "emph",
|
|
37
|
+
presetSubtype: 0,
|
|
38
|
+
defaultDurationMs: 2e3
|
|
39
|
+
},
|
|
40
|
+
fadeOut: {
|
|
41
|
+
presetID: 10,
|
|
42
|
+
presetClass: "exit",
|
|
43
|
+
presetSubtype: 0,
|
|
44
|
+
defaultDurationMs: 500
|
|
45
|
+
},
|
|
46
|
+
flyOut: {
|
|
47
|
+
presetID: 2,
|
|
48
|
+
presetClass: "exit",
|
|
49
|
+
presetSubtype: 4,
|
|
50
|
+
defaultDurationMs: 500
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { ANIM_PRESET_IDENTITY as t };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=anim-presets-CF4p8mnd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anim-presets-CF4p8mnd.js","names":[],"sources":["../src/ooxml/anim-presets.ts"],"sourcesContent":["/**\n * The build-animation presets `addAnimation` writes, by the identity PowerPoint gives each one in its\n * effect's `p:cTn` (`@presetClass`, `@presetID`, `@presetSubtype`) and the duration it takes when the\n * caller states none.\n *\n * `gen/anim/animation.ts` writes each preset from its row here, and `script/from-read/animation.ts`\n * recognises a read effect by the same row, so the two cannot disagree about which effect is which.\n *\n * This module keeps `ooxml/`'s no-runtime-imports property: the reference below is type-only.\n */\n\nimport type { PresetEffect } from '../types/animation.js'\n\n/** One preset's identity in the timing tree and its default duration. */\nexport interface AnimPresetIdentity {\n\tpresetID: number\n\tpresetClass: 'entr' | 'emph' | 'exit'\n\tpresetSubtype: number\n\tdefaultDurationMs: number\n}\n\n/** Every preset `addAnimation` writes. `satisfies` makes a preset added without a row a compile error. */\nexport const ANIM_PRESET_IDENTITY = {\n\tfadeIn: { presetID: 10, presetClass: 'entr', presetSubtype: 0, defaultDurationMs: 500 },\n\tflyIn: { presetID: 2, presetClass: 'entr', presetSubtype: 4, defaultDurationMs: 500 },\n\tappear: { presetID: 1, presetClass: 'entr', presetSubtype: 0, defaultDurationMs: 500 },\n\twipe: { presetID: 22, presetClass: 'entr', presetSubtype: 4, defaultDurationMs: 500 },\n\tgrow: { presetID: 6, presetClass: 'emph', presetSubtype: 0, defaultDurationMs: 2000 },\n\tspin: { presetID: 8, presetClass: 'emph', presetSubtype: 0, defaultDurationMs: 2000 },\n\tfadeOut: { presetID: 10, presetClass: 'exit', presetSubtype: 0, defaultDurationMs: 500 },\n\tflyOut: { presetID: 2, presetClass: 'exit', presetSubtype: 4, defaultDurationMs: 500 },\n} as const satisfies Record<PresetEffect, AnimPresetIdentity>\n"],"mappings":";;AAsBA,MAAa,uBAAuB;CACnC,QAAQ;EAAE,UAAU;EAAI,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAI;CACtF,OAAO;EAAE,UAAU;EAAG,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAI;CACpF,QAAQ;EAAE,UAAU;EAAG,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAI;CACrF,MAAM;EAAE,UAAU;EAAI,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAI;CACpF,MAAM;EAAE,UAAU;EAAG,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAK;CACpF,MAAM;EAAE,UAAU;EAAG,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAK;CACpF,SAAS;EAAE,UAAU;EAAI,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAI;CACvF,QAAQ;EAAE,UAAU;EAAG,aAAa;EAAQ,eAAe;EAAG,mBAAmB;CAAI;AACtF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as usableTableWidthEmu, R as DEF_SLIDE_MARGIN_IN, _ as resolveCellMarginsInches, b as resolveTableColWidthsEmu, c as inch2Emu, d as marginToEmu, m as pinnedRowHeightInches, s as getSmartParseNumber, t as autoPageLineHeightEmu, y as resolveSlideMarginsInches } from "./units-internal-
|
|
3
|
-
import { F as EMU_PER_INCH } from "./
|
|
4
|
-
import {
|
|
1
|
+
import { u as warn } from "./entry-errors-BRMlRV9p.js";
|
|
2
|
+
import { C as usableTableWidthEmu, R as DEF_SLIDE_MARGIN_IN, _ as resolveCellMarginsInches, b as resolveTableColWidthsEmu, c as inch2Emu, d as marginToEmu, m as pinnedRowHeightInches, s as getSmartParseNumber, t as autoPageLineHeightEmu, y as resolveSlideMarginsInches } from "./units-internal-CKHeSXX2.js";
|
|
3
|
+
import { F as EMU_PER_INCH } from "./enums-BwXKwMmg.js";
|
|
4
|
+
import { n as tableColCount, o as resolveSpan, r as walkTableGrid, s as withCheckedSpans } from "./grid-BPkvmUH2.js";
|
|
5
5
|
//#region src/gen/table/autopage.ts
|
|
6
6
|
/**
|
|
7
7
|
* A cell for the pager's working grid, carrying the source cell's options only when it has some.
|
|
@@ -533,4 +533,4 @@ function getSlidesForTableRows(rows = [], tableProps = {}, presLayout, masterSli
|
|
|
533
533
|
//#endregion
|
|
534
534
|
export { getSlidesForTableRows as t };
|
|
535
535
|
|
|
536
|
-
//# sourceMappingURL=autopage-
|
|
536
|
+
//# sourceMappingURL=autopage-8Pwh-jsI.js.map
|