pptx-templates 0.1.0 → 0.1.2
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/AI-INSTRUCTOR.md +97 -0
- package/CHANGELOG.md +23 -1
- package/README.md +2 -4
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.js +6 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/run-merge/index.d.ts +13 -0
- package/dist/extensions/run-merge/index.js +89 -0
- package/dist/extensions/run-merge/index.js.map +1 -0
- package/dist/extensions/shape-geometry/index.d.ts +53 -0
- package/dist/extensions/shape-geometry/index.js +242 -0
- package/dist/extensions/shape-geometry/index.js.map +1 -0
- package/dist/extensions/shape-geometry/presets.d.ts +12 -0
- package/dist/extensions/shape-geometry/presets.js +421 -0
- package/dist/extensions/shape-geometry/presets.js.map +1 -0
- package/dist/extensions/shape-geometry/types.d.ts +29 -0
- package/dist/extensions/shape-geometry/types.js +3 -0
- package/dist/extensions/shape-geometry/types.js.map +1 -0
- package/dist/extensions/template-logic/images.js +42 -1
- package/dist/extensions/template-logic/images.js.map +1 -1
- package/dist/extensions/template-logic/types.d.ts +18 -0
- package/dist/helper/text-replace-helper.js +2 -0
- package/dist/helper/text-replace-helper.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresetAdjustmentDefaults = exports.ShapePresets = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* ST_ShapeType of the DrawingML spec: every preset geometry PowerPoint knows.
|
|
6
|
+
* Same list as docx-templates' `ImageShapes`.
|
|
7
|
+
*/
|
|
8
|
+
exports.ShapePresets = [
|
|
9
|
+
'line',
|
|
10
|
+
'lineInv',
|
|
11
|
+
'triangle',
|
|
12
|
+
'rtTriangle',
|
|
13
|
+
'rect',
|
|
14
|
+
'diamond',
|
|
15
|
+
'parallelogram',
|
|
16
|
+
'trapezoid',
|
|
17
|
+
'nonIsoscelesTrapezoid',
|
|
18
|
+
'pentagon',
|
|
19
|
+
'hexagon',
|
|
20
|
+
'heptagon',
|
|
21
|
+
'octagon',
|
|
22
|
+
'decagon',
|
|
23
|
+
'dodecagon',
|
|
24
|
+
'star4',
|
|
25
|
+
'star5',
|
|
26
|
+
'star6',
|
|
27
|
+
'star7',
|
|
28
|
+
'star8',
|
|
29
|
+
'star10',
|
|
30
|
+
'star12',
|
|
31
|
+
'star16',
|
|
32
|
+
'star24',
|
|
33
|
+
'star32',
|
|
34
|
+
'roundRect',
|
|
35
|
+
'round1Rect',
|
|
36
|
+
'round2SameRect',
|
|
37
|
+
'round2DiagRect',
|
|
38
|
+
'snipRoundRect',
|
|
39
|
+
'snip1Rect',
|
|
40
|
+
'snip2SameRect',
|
|
41
|
+
'snip2DiagRect',
|
|
42
|
+
'plaque',
|
|
43
|
+
'ellipse',
|
|
44
|
+
'teardrop',
|
|
45
|
+
'homePlate',
|
|
46
|
+
'chevron',
|
|
47
|
+
'pieWedge',
|
|
48
|
+
'pie',
|
|
49
|
+
'blockArc',
|
|
50
|
+
'donut',
|
|
51
|
+
'noSmoking',
|
|
52
|
+
'rightArrow',
|
|
53
|
+
'leftArrow',
|
|
54
|
+
'upArrow',
|
|
55
|
+
'downArrow',
|
|
56
|
+
'stripedRightArrow',
|
|
57
|
+
'notchedRightArrow',
|
|
58
|
+
'bentUpArrow',
|
|
59
|
+
'leftRightArrow',
|
|
60
|
+
'upDownArrow',
|
|
61
|
+
'leftUpArrow',
|
|
62
|
+
'leftRightUpArrow',
|
|
63
|
+
'quadArrow',
|
|
64
|
+
'leftArrowCallout',
|
|
65
|
+
'rightArrowCallout',
|
|
66
|
+
'upArrowCallout',
|
|
67
|
+
'downArrowCallout',
|
|
68
|
+
'leftRightArrowCallout',
|
|
69
|
+
'upDownArrowCallout',
|
|
70
|
+
'quadArrowCallout',
|
|
71
|
+
'bentArrow',
|
|
72
|
+
'uturnArrow',
|
|
73
|
+
'circularArrow',
|
|
74
|
+
'leftCircularArrow',
|
|
75
|
+
'leftRightCircularArrow',
|
|
76
|
+
'curvedRightArrow',
|
|
77
|
+
'curvedLeftArrow',
|
|
78
|
+
'curvedUpArrow',
|
|
79
|
+
'curvedDownArrow',
|
|
80
|
+
'swooshArrow',
|
|
81
|
+
'cube',
|
|
82
|
+
'can',
|
|
83
|
+
'lightningBolt',
|
|
84
|
+
'heart',
|
|
85
|
+
'sun',
|
|
86
|
+
'moon',
|
|
87
|
+
'smileyFace',
|
|
88
|
+
'irregularSeal1',
|
|
89
|
+
'irregularSeal2',
|
|
90
|
+
'foldedCorner',
|
|
91
|
+
'bevel',
|
|
92
|
+
'frame',
|
|
93
|
+
'halfFrame',
|
|
94
|
+
'corner',
|
|
95
|
+
'diagStripe',
|
|
96
|
+
'chord',
|
|
97
|
+
'arc',
|
|
98
|
+
'leftBracket',
|
|
99
|
+
'rightBracket',
|
|
100
|
+
'leftBrace',
|
|
101
|
+
'rightBrace',
|
|
102
|
+
'bracketPair',
|
|
103
|
+
'bracePair',
|
|
104
|
+
'straightConnector1',
|
|
105
|
+
'bentConnector2',
|
|
106
|
+
'bentConnector3',
|
|
107
|
+
'bentConnector4',
|
|
108
|
+
'bentConnector5',
|
|
109
|
+
'curvedConnector2',
|
|
110
|
+
'curvedConnector3',
|
|
111
|
+
'curvedConnector4',
|
|
112
|
+
'curvedConnector5',
|
|
113
|
+
'callout1',
|
|
114
|
+
'callout2',
|
|
115
|
+
'callout3',
|
|
116
|
+
'accentCallout1',
|
|
117
|
+
'accentCallout2',
|
|
118
|
+
'accentCallout3',
|
|
119
|
+
'borderCallout1',
|
|
120
|
+
'borderCallout2',
|
|
121
|
+
'borderCallout3',
|
|
122
|
+
'accentBorderCallout1',
|
|
123
|
+
'accentBorderCallout2',
|
|
124
|
+
'accentBorderCallout3',
|
|
125
|
+
'wedgeRectCallout',
|
|
126
|
+
'wedgeRoundRectCallout',
|
|
127
|
+
'wedgeEllipseCallout',
|
|
128
|
+
'cloudCallout',
|
|
129
|
+
'cloud',
|
|
130
|
+
'ribbon',
|
|
131
|
+
'ribbon2',
|
|
132
|
+
'ellipseRibbon',
|
|
133
|
+
'ellipseRibbon2',
|
|
134
|
+
'leftRightRibbon',
|
|
135
|
+
'verticalScroll',
|
|
136
|
+
'horizontalScroll',
|
|
137
|
+
'wave',
|
|
138
|
+
'doubleWave',
|
|
139
|
+
'plus',
|
|
140
|
+
'flowChartProcess',
|
|
141
|
+
'flowChartDecision',
|
|
142
|
+
'flowChartInputOutput',
|
|
143
|
+
'flowChartPredefinedProcess',
|
|
144
|
+
'flowChartInternalStorage',
|
|
145
|
+
'flowChartDocument',
|
|
146
|
+
'flowChartMultidocument',
|
|
147
|
+
'flowChartTerminator',
|
|
148
|
+
'flowChartPreparation',
|
|
149
|
+
'flowChartManualInput',
|
|
150
|
+
'flowChartManualOperation',
|
|
151
|
+
'flowChartConnector',
|
|
152
|
+
'flowChartPunchedCard',
|
|
153
|
+
'flowChartPunchedTape',
|
|
154
|
+
'flowChartSummingJunction',
|
|
155
|
+
'flowChartOr',
|
|
156
|
+
'flowChartCollate',
|
|
157
|
+
'flowChartSort',
|
|
158
|
+
'flowChartExtract',
|
|
159
|
+
'flowChartMerge',
|
|
160
|
+
'flowChartOfflineStorage',
|
|
161
|
+
'flowChartOnlineStorage',
|
|
162
|
+
'flowChartMagneticTape',
|
|
163
|
+
'flowChartMagneticDisk',
|
|
164
|
+
'flowChartMagneticDrum',
|
|
165
|
+
'flowChartDisplay',
|
|
166
|
+
'flowChartDelay',
|
|
167
|
+
'flowChartAlternateProcess',
|
|
168
|
+
'flowChartOffpageConnector',
|
|
169
|
+
'actionButtonBlank',
|
|
170
|
+
'actionButtonHome',
|
|
171
|
+
'actionButtonHelp',
|
|
172
|
+
'actionButtonInformation',
|
|
173
|
+
'actionButtonForwardNext',
|
|
174
|
+
'actionButtonBackPrevious',
|
|
175
|
+
'actionButtonEnd',
|
|
176
|
+
'actionButtonBeginning',
|
|
177
|
+
'actionButtonReturn',
|
|
178
|
+
'actionButtonDocument',
|
|
179
|
+
'actionButtonSound',
|
|
180
|
+
'actionButtonMovie',
|
|
181
|
+
'gear6',
|
|
182
|
+
'gear9',
|
|
183
|
+
'funnel',
|
|
184
|
+
'mathPlus',
|
|
185
|
+
'mathMinus',
|
|
186
|
+
'mathMultiply',
|
|
187
|
+
'mathDivide',
|
|
188
|
+
'mathEqual',
|
|
189
|
+
'mathNotEqual',
|
|
190
|
+
'cornerTabs',
|
|
191
|
+
'squareTabs',
|
|
192
|
+
'plaqueTabs',
|
|
193
|
+
'chartX',
|
|
194
|
+
'chartStar',
|
|
195
|
+
'chartPlus',
|
|
196
|
+
];
|
|
197
|
+
/**
|
|
198
|
+
* Default adjust values of the presets that have any, from
|
|
199
|
+
* presetShapeDefinitions.xml (ECMA-376 Part 1, Annex D). PowerPoint asks to
|
|
200
|
+
* repair a file whose <a:avLst> lists only some guides of a shape, so a
|
|
201
|
+
* partial set is completed with these defaults.
|
|
202
|
+
*/
|
|
203
|
+
exports.PresetAdjustmentDefaults = {
|
|
204
|
+
triangle: { adj: 50000 },
|
|
205
|
+
parallelogram: { adj: 25000 },
|
|
206
|
+
trapezoid: { adj: 25000 },
|
|
207
|
+
nonIsoscelesTrapezoid: { adj1: 25000, adj2: 25000 },
|
|
208
|
+
pentagon: { hf: 105146, vf: 110557 },
|
|
209
|
+
hexagon: { adj: 25000, vf: 115470 },
|
|
210
|
+
heptagon: { hf: 102572, vf: 105210 },
|
|
211
|
+
octagon: { adj: 29289 },
|
|
212
|
+
decagon: { vf: 105146 },
|
|
213
|
+
star4: { adj: 12500 },
|
|
214
|
+
star5: { adj: 19098, hf: 105146, vf: 110557 },
|
|
215
|
+
star6: { adj: 28868, hf: 115470 },
|
|
216
|
+
star7: { adj: 34601, hf: 102572, vf: 105210 },
|
|
217
|
+
star8: { adj: 37500 },
|
|
218
|
+
star10: { adj: 42533, hf: 105146 },
|
|
219
|
+
star12: { adj: 37500 },
|
|
220
|
+
star16: { adj: 37500 },
|
|
221
|
+
star24: { adj: 37500 },
|
|
222
|
+
star32: { adj: 37500 },
|
|
223
|
+
roundRect: { adj: 16667 },
|
|
224
|
+
round1Rect: { adj: 16667 },
|
|
225
|
+
round2SameRect: { adj1: 16667, adj2: 0 },
|
|
226
|
+
round2DiagRect: { adj1: 16667, adj2: 0 },
|
|
227
|
+
snipRoundRect: { adj1: 16667, adj2: 16667 },
|
|
228
|
+
snip1Rect: { adj: 16667 },
|
|
229
|
+
snip2SameRect: { adj1: 16667, adj2: 0 },
|
|
230
|
+
snip2DiagRect: { adj1: 0, adj2: 16667 },
|
|
231
|
+
plaque: { adj: 16667 },
|
|
232
|
+
teardrop: { adj: 100000 },
|
|
233
|
+
homePlate: { adj: 50000 },
|
|
234
|
+
chevron: { adj: 50000 },
|
|
235
|
+
pie: { adj1: 0, adj2: 16200000 },
|
|
236
|
+
blockArc: { adj1: 10800000, adj2: 0, adj3: 25000 },
|
|
237
|
+
donut: { adj: 25000 },
|
|
238
|
+
noSmoking: { adj: 18750 },
|
|
239
|
+
rightArrow: { adj1: 50000, adj2: 50000 },
|
|
240
|
+
leftArrow: { adj1: 50000, adj2: 50000 },
|
|
241
|
+
upArrow: { adj1: 50000, adj2: 50000 },
|
|
242
|
+
downArrow: { adj1: 50000, adj2: 50000 },
|
|
243
|
+
stripedRightArrow: { adj1: 50000, adj2: 50000 },
|
|
244
|
+
notchedRightArrow: { adj1: 50000, adj2: 50000 },
|
|
245
|
+
bentUpArrow: { adj1: 25000, adj2: 25000, adj3: 25000 },
|
|
246
|
+
leftRightArrow: { adj1: 50000, adj2: 50000 },
|
|
247
|
+
upDownArrow: { adj1: 50000, adj2: 50000 },
|
|
248
|
+
leftUpArrow: { adj1: 25000, adj2: 25000, adj3: 25000 },
|
|
249
|
+
leftRightUpArrow: { adj1: 25000, adj2: 25000, adj3: 25000 },
|
|
250
|
+
quadArrow: { adj1: 22500, adj2: 22500, adj3: 22500 },
|
|
251
|
+
leftArrowCallout: { adj1: 25000, adj2: 25000, adj3: 25000, adj4: 64977 },
|
|
252
|
+
rightArrowCallout: { adj1: 25000, adj2: 25000, adj3: 25000, adj4: 64977 },
|
|
253
|
+
upArrowCallout: { adj1: 25000, adj2: 25000, adj3: 25000, adj4: 64977 },
|
|
254
|
+
downArrowCallout: { adj1: 25000, adj2: 25000, adj3: 25000, adj4: 64977 },
|
|
255
|
+
leftRightArrowCallout: { adj1: 25000, adj2: 25000, adj3: 25000, adj4: 48123 },
|
|
256
|
+
upDownArrowCallout: { adj1: 25000, adj2: 25000, adj3: 25000, adj4: 48123 },
|
|
257
|
+
quadArrowCallout: { adj1: 18515, adj2: 18515, adj3: 18515, adj4: 48123 },
|
|
258
|
+
bentArrow: { adj1: 25000, adj2: 25000, adj3: 25000, adj4: 43750 },
|
|
259
|
+
uturnArrow: {
|
|
260
|
+
adj1: 25000,
|
|
261
|
+
adj2: 25000,
|
|
262
|
+
adj3: 25000,
|
|
263
|
+
adj4: 43750,
|
|
264
|
+
adj5: 75000,
|
|
265
|
+
},
|
|
266
|
+
circularArrow: {
|
|
267
|
+
adj1: 12500,
|
|
268
|
+
adj2: 1142319,
|
|
269
|
+
adj3: 20457681,
|
|
270
|
+
adj4: 10800000,
|
|
271
|
+
adj5: 12500,
|
|
272
|
+
},
|
|
273
|
+
leftCircularArrow: {
|
|
274
|
+
adj1: 12500,
|
|
275
|
+
adj2: -1142319,
|
|
276
|
+
adj3: 1142319,
|
|
277
|
+
adj4: 10800000,
|
|
278
|
+
adj5: 12500,
|
|
279
|
+
},
|
|
280
|
+
leftRightCircularArrow: {
|
|
281
|
+
adj1: 12500,
|
|
282
|
+
adj2: 1142319,
|
|
283
|
+
adj3: 20457681,
|
|
284
|
+
adj4: 11942319,
|
|
285
|
+
adj5: 12500,
|
|
286
|
+
},
|
|
287
|
+
curvedRightArrow: { adj1: 25000, adj2: 50000, adj3: 25000 },
|
|
288
|
+
curvedLeftArrow: { adj1: 25000, adj2: 50000, adj3: 25000 },
|
|
289
|
+
curvedUpArrow: { adj1: 25000, adj2: 50000, adj3: 25000 },
|
|
290
|
+
curvedDownArrow: { adj1: 25000, adj2: 50000, adj3: 25000 },
|
|
291
|
+
swooshArrow: { adj1: 25000, adj2: 16667 },
|
|
292
|
+
cube: { adj: 25000 },
|
|
293
|
+
can: { adj: 25000 },
|
|
294
|
+
sun: { adj: 25000 },
|
|
295
|
+
moon: { adj: 50000 },
|
|
296
|
+
smileyFace: { adj: 4653 },
|
|
297
|
+
foldedCorner: { adj: 16667 },
|
|
298
|
+
bevel: { adj: 12500 },
|
|
299
|
+
frame: { adj1: 12500 },
|
|
300
|
+
halfFrame: { adj1: 33333, adj2: 33333 },
|
|
301
|
+
corner: { adj1: 50000, adj2: 50000 },
|
|
302
|
+
diagStripe: { adj: 50000 },
|
|
303
|
+
chord: { adj1: 2700000, adj2: 16200000 },
|
|
304
|
+
arc: { adj1: 16200000, adj2: 0 },
|
|
305
|
+
leftBracket: { adj: 8333 },
|
|
306
|
+
rightBracket: { adj: 8333 },
|
|
307
|
+
leftBrace: { adj1: 8333, adj2: 50000 },
|
|
308
|
+
rightBrace: { adj1: 8333, adj2: 50000 },
|
|
309
|
+
bracketPair: { adj: 16667 },
|
|
310
|
+
bracePair: { adj: 8333 },
|
|
311
|
+
bentConnector3: { adj1: 50000 },
|
|
312
|
+
bentConnector4: { adj1: 50000, adj2: 50000 },
|
|
313
|
+
bentConnector5: { adj1: 50000, adj2: 50000, adj3: 50000 },
|
|
314
|
+
curvedConnector3: { adj1: 50000 },
|
|
315
|
+
curvedConnector4: { adj1: 50000, adj2: 50000 },
|
|
316
|
+
curvedConnector5: { adj1: 50000, adj2: 50000, adj3: 50000 },
|
|
317
|
+
callout1: { adj1: 18750, adj2: -8333, adj3: 112500, adj4: -38333 },
|
|
318
|
+
callout2: {
|
|
319
|
+
adj1: 18750,
|
|
320
|
+
adj2: -8333,
|
|
321
|
+
adj3: 18750,
|
|
322
|
+
adj4: -16667,
|
|
323
|
+
adj5: 112500,
|
|
324
|
+
adj6: -46667,
|
|
325
|
+
},
|
|
326
|
+
callout3: {
|
|
327
|
+
adj1: 18750,
|
|
328
|
+
adj2: -8333,
|
|
329
|
+
adj3: 18750,
|
|
330
|
+
adj4: -16667,
|
|
331
|
+
adj5: 100000,
|
|
332
|
+
adj6: -16667,
|
|
333
|
+
adj7: 112963,
|
|
334
|
+
adj8: -8333,
|
|
335
|
+
},
|
|
336
|
+
accentCallout1: { adj1: 18750, adj2: -8333, adj3: 112500, adj4: -38333 },
|
|
337
|
+
accentCallout2: {
|
|
338
|
+
adj1: 18750,
|
|
339
|
+
adj2: -8333,
|
|
340
|
+
adj3: 18750,
|
|
341
|
+
adj4: -16667,
|
|
342
|
+
adj5: 112500,
|
|
343
|
+
adj6: -46667,
|
|
344
|
+
},
|
|
345
|
+
accentCallout3: {
|
|
346
|
+
adj1: 18750,
|
|
347
|
+
adj2: -8333,
|
|
348
|
+
adj3: 18750,
|
|
349
|
+
adj4: -16667,
|
|
350
|
+
adj5: 100000,
|
|
351
|
+
adj6: -16667,
|
|
352
|
+
adj7: 112963,
|
|
353
|
+
adj8: -8333,
|
|
354
|
+
},
|
|
355
|
+
borderCallout1: { adj1: 18750, adj2: -8333, adj3: 112500, adj4: -38333 },
|
|
356
|
+
borderCallout2: {
|
|
357
|
+
adj1: 18750,
|
|
358
|
+
adj2: -8333,
|
|
359
|
+
adj3: 18750,
|
|
360
|
+
adj4: -16667,
|
|
361
|
+
adj5: 112500,
|
|
362
|
+
adj6: -46667,
|
|
363
|
+
},
|
|
364
|
+
borderCallout3: {
|
|
365
|
+
adj1: 18750,
|
|
366
|
+
adj2: -8333,
|
|
367
|
+
adj3: 18750,
|
|
368
|
+
adj4: -16667,
|
|
369
|
+
adj5: 100000,
|
|
370
|
+
adj6: -16667,
|
|
371
|
+
adj7: 112963,
|
|
372
|
+
adj8: -8333,
|
|
373
|
+
},
|
|
374
|
+
accentBorderCallout1: {
|
|
375
|
+
adj1: 18750,
|
|
376
|
+
adj2: -8333,
|
|
377
|
+
adj3: 112500,
|
|
378
|
+
adj4: -38333,
|
|
379
|
+
},
|
|
380
|
+
accentBorderCallout2: {
|
|
381
|
+
adj1: 18750,
|
|
382
|
+
adj2: -8333,
|
|
383
|
+
adj3: 18750,
|
|
384
|
+
adj4: -16667,
|
|
385
|
+
adj5: 112500,
|
|
386
|
+
adj6: -46667,
|
|
387
|
+
},
|
|
388
|
+
accentBorderCallout3: {
|
|
389
|
+
adj1: 18750,
|
|
390
|
+
adj2: -8333,
|
|
391
|
+
adj3: 18750,
|
|
392
|
+
adj4: -16667,
|
|
393
|
+
adj5: 100000,
|
|
394
|
+
adj6: -16667,
|
|
395
|
+
adj7: 112963,
|
|
396
|
+
adj8: -8333,
|
|
397
|
+
},
|
|
398
|
+
wedgeRectCallout: { adj1: -20833, adj2: 62500 },
|
|
399
|
+
wedgeRoundRectCallout: { adj1: -20833, adj2: 62500, adj3: 16667 },
|
|
400
|
+
wedgeEllipseCallout: { adj1: -20833, adj2: 62500 },
|
|
401
|
+
cloudCallout: { adj1: -20833, adj2: 62500 },
|
|
402
|
+
ribbon: { adj1: 16667, adj2: 50000 },
|
|
403
|
+
ribbon2: { adj1: 16667, adj2: 50000 },
|
|
404
|
+
ellipseRibbon: { adj1: 25000, adj2: 50000, adj3: 12500 },
|
|
405
|
+
ellipseRibbon2: { adj1: 25000, adj2: 50000, adj3: 12500 },
|
|
406
|
+
leftRightRibbon: { adj1: 50000, adj2: 50000, adj3: 16667 },
|
|
407
|
+
verticalScroll: { adj: 12500 },
|
|
408
|
+
horizontalScroll: { adj: 12500 },
|
|
409
|
+
wave: { adj1: 12500, adj2: 0 },
|
|
410
|
+
doubleWave: { adj1: 6250, adj2: 0 },
|
|
411
|
+
plus: { adj: 25000 },
|
|
412
|
+
gear6: { adj1: 15000, adj2: 3526 },
|
|
413
|
+
gear9: { adj1: 10000, adj2: 1763 },
|
|
414
|
+
mathPlus: { adj1: 23520 },
|
|
415
|
+
mathMinus: { adj1: 23520 },
|
|
416
|
+
mathMultiply: { adj1: 23520 },
|
|
417
|
+
mathDivide: { adj1: 23520, adj2: 5880, adj3: 11760 },
|
|
418
|
+
mathEqual: { adj1: 23520, adj2: 11760 },
|
|
419
|
+
mathNotEqual: { adj1: 23520, adj2: 6600000, adj3: 11760 },
|
|
420
|
+
};
|
|
421
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../src/extensions/shape-geometry/presets.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B,MAAM;IACN,SAAS;IACT,UAAU;IACV,YAAY;IACZ,MAAM;IACN,SAAS;IACT,eAAe;IACf,WAAW;IACX,uBAAuB;IACvB,UAAU;IACV,SAAS;IACT,UAAU;IACV,SAAS;IACT,SAAS;IACT,WAAW;IACX,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,WAAW;IACX,eAAe;IACf,eAAe;IACf,QAAQ;IACR,SAAS;IACT,UAAU;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,KAAK;IACL,UAAU;IACV,OAAO;IACP,WAAW;IACX,YAAY;IACZ,WAAW;IACX,SAAS;IACT,WAAW;IACX,mBAAmB;IACnB,mBAAmB;IACnB,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,WAAW;IACX,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,uBAAuB;IACvB,oBAAoB;IACpB,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,eAAe;IACf,mBAAmB;IACn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K,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;IACzD,eAAe,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;IAC1D,cAAc,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;IAC9B,gBAAgB,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;IAChC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE;IAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;IACnC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;IACpB,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;IAClC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE;IAClC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACzB,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IAC1B,YAAY,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IAC7B,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE;IACpD,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;IACvC,YAAY,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE;CAC1D,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ShapePresets } from './presets';
|
|
2
|
+
/** A DrawingML preset geometry, e.g. 'roundRect', 'ellipse', 'heart'. */
|
|
3
|
+
export type ShapePreset = (typeof ShapePresets)[number];
|
|
4
|
+
/** Preset geometries whose corner radius `setCornerRadius` can set. */
|
|
5
|
+
export type RoundedShapePreset = 'roundRect' | 'round1Rect' | 'round2SameRect' | 'round2DiagRect' | 'snipRoundRect';
|
|
6
|
+
/**
|
|
7
|
+
* Corner radius, measured on the shorter side of the shape:
|
|
8
|
+
* - a number: centimeters (as in docx-templates)
|
|
9
|
+
* - a string with unit: `'10%'` (of the shorter side), `'12px'` (96 dpi),
|
|
10
|
+
* `'4pt'`, `'0.5cm'`, `'5mm'`
|
|
11
|
+
*
|
|
12
|
+
* The radius is capped at half the shorter side (`'50%'`).
|
|
13
|
+
*/
|
|
14
|
+
export type CornerRadius = number | string;
|
|
15
|
+
/**
|
|
16
|
+
* Raw adjust values of a preset geometry (the yellow handles in
|
|
17
|
+
* PowerPoint), keyed by guide name, e.g. `{ adj: 25000 }`. Names and value
|
|
18
|
+
* ranges depend on the shape; most are in 1/100000 of the shorter side.
|
|
19
|
+
*/
|
|
20
|
+
export type ShapeAdjustments = {
|
|
21
|
+
[name: string]: number;
|
|
22
|
+
};
|
|
23
|
+
/** Border of an `{{IMAGE}}` picture (docx-templates compatible). */
|
|
24
|
+
export type ImageBorder = {
|
|
25
|
+
/** Hex RGB color, e.g. '#ff0000' or 'ff0000'. */
|
|
26
|
+
color: string;
|
|
27
|
+
/** Width in points. */
|
|
28
|
+
width: number;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/extensions/shape-geometry/types.ts"],"names":[],"mappings":""}
|
|
@@ -8,12 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.placeImages = exports.loadImage = void 0;
|
|
13
16
|
const xml_helper_1 = require("../../helper/xml-helper");
|
|
14
17
|
const xml_relationship_helper_1 = require("../../helper/xml-relationship-helper");
|
|
15
18
|
const ppt_paths_1 = require("../../helper/ppt-paths");
|
|
16
19
|
const image_dimensions_1 = require("../../helper/image-dimensions");
|
|
20
|
+
const modify_shape_helper_1 = __importDefault(require("../../helper/modify-shape-helper"));
|
|
21
|
+
const shape_geometry_1 = require("../shape-geometry");
|
|
17
22
|
/**
|
|
18
23
|
* {{IMAGE …}} support: writes the image into ppt/media (deduplicated), adds
|
|
19
24
|
* the content type and the slide relationship, and places a <p:pic> where
|
|
@@ -28,6 +33,7 @@ const MIME_EXTENSIONS = {
|
|
|
28
33
|
};
|
|
29
34
|
const SUPPORTED = ['png', 'jpg', 'jpeg', 'gif'];
|
|
30
35
|
const EMU_PER_CM = 360000;
|
|
36
|
+
const EMU_PER_PT = 12700;
|
|
31
37
|
/** Validates an IMAGE value and decodes its data. */
|
|
32
38
|
const loadImage = (value) => {
|
|
33
39
|
var _a;
|
|
@@ -57,9 +63,43 @@ const loadImage = (value) => {
|
|
|
57
63
|
if (!extension || !SUPPORTED.includes(extension)) {
|
|
58
64
|
throw new Error(`IMAGE: unsupported extension "${extension !== null && extension !== void 0 ? extension : ''}" (use ${SUPPORTED.join(', ')})`);
|
|
59
65
|
}
|
|
66
|
+
if (spec.border) {
|
|
67
|
+
const { color, width } = spec.border;
|
|
68
|
+
if (typeof color !== 'string' || !/^#?[0-9a-f]{6}$/i.test(color)) {
|
|
69
|
+
throw new Error(`IMAGE: invalid border color ${String(color)} (a hex RGB color, e.g. '#ff0000')`);
|
|
70
|
+
}
|
|
71
|
+
if (!Number.isFinite(width) || width < 0) {
|
|
72
|
+
throw new Error(`IMAGE: invalid border width ${String(width)} (in pt)`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Fails early on a bad shape or radius; the real size comes with the slot.
|
|
76
|
+
geometryFor(spec, { cx: 1, cy: 1 });
|
|
60
77
|
return { spec, content, extension };
|
|
61
78
|
};
|
|
62
79
|
exports.loadImage = loadImage;
|
|
80
|
+
const geometryFor = (spec, size) => {
|
|
81
|
+
try {
|
|
82
|
+
return (0, shape_geometry_1.resolveGeometry)(spec, size);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
throw new Error(`IMAGE: ${error.message}`, { cause: error });
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/** shape/cornerRadius/shapeAdjustments and border of an IMAGE picture. */
|
|
89
|
+
const styleShape = (picture, image, box) => {
|
|
90
|
+
const { spec } = image;
|
|
91
|
+
const spPr = xml_helper_1.XmlHelper.getFirstDirectChild(picture, ['p:spPr']);
|
|
92
|
+
(0, shape_geometry_1.applyGeometry)(spPr, geometryFor(spec, box));
|
|
93
|
+
if (spec.border) {
|
|
94
|
+
modify_shape_helper_1.default.setOutline({
|
|
95
|
+
weight: Math.round(spec.border.width * EMU_PER_PT),
|
|
96
|
+
color: {
|
|
97
|
+
type: 'srgbClr',
|
|
98
|
+
value: spec.border.color.replace(/^#/, '').toUpperCase(),
|
|
99
|
+
},
|
|
100
|
+
})(picture);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
63
103
|
const childElement = (parent, tagName) => {
|
|
64
104
|
for (let node = parent === null || parent === void 0 ? void 0 : parent.firstChild; node; node = node.nextSibling) {
|
|
65
105
|
if (node.nodeType === 1 && node.tagName === tagName) {
|
|
@@ -152,7 +192,7 @@ const createPicture = (shape, relId, image, box, id) => {
|
|
|
152
192
|
if (image.spec.rotation) {
|
|
153
193
|
xfrmAttrs.rot = Math.round(image.spec.rotation * 60000);
|
|
154
194
|
}
|
|
155
|
-
return el('p:pic', {}, el('p:nvPicPr', {}, el('p:cNvPr', Object.assign({ id, name: `Picture ${id}` }, (image.spec.alt ? { descr: image.spec.alt } : {}))), el('p:cNvPicPr', {}, el('a:picLocks', { noChangeAspect: 1 })), el('p:nvPr')), el('p:blipFill', {}, el('a:blip', { 'r:embed': relId }), el('a:stretch', {}, el('a:fillRect'))), el('p:spPr', {}, el('a:xfrm', xfrmAttrs, el('a:off', { x: Math.round(box.x), y: Math.round(box.y) }), el('a:ext', { cx: Math.round(box.cx), cy: Math.round(box.cy) }))
|
|
195
|
+
return el('p:pic', {}, el('p:nvPicPr', {}, el('p:cNvPr', Object.assign({ id, name: `Picture ${id}` }, (image.spec.alt ? { descr: image.spec.alt } : {}))), el('p:cNvPicPr', {}, el('a:picLocks', { noChangeAspect: 1 })), el('p:nvPr')), el('p:blipFill', {}, el('a:blip', { 'r:embed': relId }), el('a:stretch', {}, el('a:fillRect'))), el('p:spPr', {}, el('a:xfrm', xfrmAttrs, el('a:off', { x: Math.round(box.x), y: Math.round(box.y) }), el('a:ext', { cx: Math.round(box.cx), cy: Math.round(box.cy) }))));
|
|
156
196
|
};
|
|
157
197
|
/**
|
|
158
198
|
* Places the images rendered from one shape's text: side by side, each in
|
|
@@ -173,6 +213,7 @@ const placeImages = (target, shape, images, removeShape) => __awaiter(void 0, vo
|
|
|
173
213
|
const box = Object.assign({ x: slot.x + (slot.cx - size.cx) / 2, y: slot.y + (slot.cy - size.cy) / 2 }, size);
|
|
174
214
|
const relId = addRelation(target, yield mediaFile(target, images[i]));
|
|
175
215
|
const picture = createPicture(shape, relId, images[i], box, nextShapeId(target, shape));
|
|
216
|
+
styleShape(picture, images[i], box);
|
|
176
217
|
shape.parentNode.insertBefore(picture, anchor);
|
|
177
218
|
anchor = picture.nextSibling;
|
|
178
219
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../../src/extensions/template-logic/images.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../../src/extensions/template-logic/images.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,wDAAoD;AACpD,kFAA6E;AAC7E,sDAAkD;AAClD,oEAAgE;AAEhE,2FAAiE;AACjE,sDAAmE;AAGnE;;;;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,CAAC;QACpC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAC/B,CAAC;IAED,IAAI,WAAW;QAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC,CAAA,CAAC;AAtCW,QAAA,WAAW,eAsCtB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CornerRadius, ImageBorder, ShapeAdjustments, ShapePreset } from '../shape-geometry/types';
|
|
1
2
|
/** Values (and functions) the expressions in template tags can reference. */
|
|
2
3
|
export type TemplateData = Record<string, unknown>;
|
|
3
4
|
export type RenderTemplateOptions = {
|
|
@@ -47,6 +48,23 @@ export type TemplateImage = {
|
|
|
47
48
|
alt?: string;
|
|
48
49
|
/** Rotation in degrees, clockwise. */
|
|
49
50
|
rotation?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Shape the picture is cropped to ("Crop to Shape"): any DrawingML preset
|
|
53
|
+
* geometry, e.g. 'roundRect', 'ellipse', 'heart'. Defaults to 'rect', or to
|
|
54
|
+
* 'roundRect' when `cornerRadius` is given.
|
|
55
|
+
*/
|
|
56
|
+
shape?: ShapePreset;
|
|
57
|
+
/**
|
|
58
|
+
* Corner radius on the shorter side of the picture: a number in cm, or a
|
|
59
|
+
* string like '10%', '12px', '4pt'. '50%' is the maximum. Only for the
|
|
60
|
+
* rounded shapes ('roundRect', 'round1Rect', 'round2SameRect',
|
|
61
|
+
* 'round2DiagRect', 'snipRoundRect').
|
|
62
|
+
*/
|
|
63
|
+
cornerRadius?: CornerRadius;
|
|
64
|
+
/** Raw adjust values of the shape, e.g. `{ adj: 25000 }`. Win over `cornerRadius`. */
|
|
65
|
+
shapeAdjustments?: ShapeAdjustments;
|
|
66
|
+
/** Border along the outline of the shape: hex `color`, `width` in pt. */
|
|
67
|
+
border?: ImageBorder;
|
|
50
68
|
};
|
|
51
69
|
export type TemplateCommand = {
|
|
52
70
|
/** 1-based slide number (file name based: ppt/slides/slide<N>.xml). */
|
|
@@ -7,6 +7,7 @@ const general_helper_1 = require("./general-helper");
|
|
|
7
7
|
const regexp_escape_1 = __importDefault(require("regexp.escape"));
|
|
8
8
|
const xml_helper_1 = require("./xml-helper");
|
|
9
9
|
const modify_text_helper_1 = __importDefault(require("./modify-text-helper"));
|
|
10
|
+
const run_merge_1 = require("../extensions/run-merge");
|
|
10
11
|
class TextReplaceHelper {
|
|
11
12
|
constructor(options, element) {
|
|
12
13
|
const defaultOptions = {
|
|
@@ -23,6 +24,7 @@ class TextReplaceHelper {
|
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
isolateTaggedNodes() {
|
|
27
|
+
(0, run_merge_1.mergeRunsSplitByTags)(this.element, this.options.openingTag, this.options.closingTag);
|
|
26
28
|
const paragraphs = this.element.getElementsByTagName('a:p');
|
|
27
29
|
const pattern = this.getRegExp();
|
|
28
30
|
for (let p = 0; p < paragraphs.length; p++) {
|