pptx-ts 0.0.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.
Files changed (78) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +319 -0
  3. package/dist/autopage-DkjYZUFD.js +423 -0
  4. package/dist/autopage-DkjYZUFD.js.map +1 -0
  5. package/dist/browser.d.ts +31 -0
  6. package/dist/browser.d.ts.map +1 -0
  7. package/dist/browser.js +110 -0
  8. package/dist/browser.js.map +1 -0
  9. package/dist/diagnostics-Du_s75MT.d.ts +829 -0
  10. package/dist/diagnostics-Du_s75MT.d.ts.map +1 -0
  11. package/dist/enums-CvRYniUA.d.ts +463 -0
  12. package/dist/enums-CvRYniUA.d.ts.map +1 -0
  13. package/dist/errors-Bvln0H-7.js +112 -0
  14. package/dist/errors-Bvln0H-7.js.map +1 -0
  15. package/dist/errors-PflMPWBn.d.ts +182 -0
  16. package/dist/errors-PflMPWBn.d.ts.map +1 -0
  17. package/dist/fit-BKs0zxMI.js +1356 -0
  18. package/dist/fit-BKs0zxMI.js.map +1 -0
  19. package/dist/html-dom-B0I0QSbU.js +679 -0
  20. package/dist/html-dom-B0I0QSbU.js.map +1 -0
  21. package/dist/html.d.ts +26 -0
  22. package/dist/html.d.ts.map +1 -0
  23. package/dist/html.js +63 -0
  24. package/dist/html.js.map +1 -0
  25. package/dist/index.d.ts +24 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +57 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/inspect.d.ts +197 -0
  30. package/dist/inspect.d.ts.map +1 -0
  31. package/dist/inspect.js +317 -0
  32. package/dist/inspect.js.map +1 -0
  33. package/dist/math.d.ts +37 -0
  34. package/dist/math.d.ts.map +1 -0
  35. package/dist/math.js +203 -0
  36. package/dist/math.js.map +1 -0
  37. package/dist/measure.d.ts +313 -0
  38. package/dist/measure.d.ts.map +1 -0
  39. package/dist/measure.js +3 -0
  40. package/dist/namespaces-BVnNu7sg.js +666 -0
  41. package/dist/namespaces-BVnNu7sg.js.map +1 -0
  42. package/dist/node.d.ts +20 -0
  43. package/dist/node.d.ts.map +1 -0
  44. package/dist/node.js +55 -0
  45. package/dist/node.js.map +1 -0
  46. package/dist/notes-RLCwdlTE.js +1703 -0
  47. package/dist/notes-RLCwdlTE.js.map +1 -0
  48. package/dist/package-CaOLXSNi.d.ts +193 -0
  49. package/dist/package-CaOLXSNi.d.ts.map +1 -0
  50. package/dist/pres-C5__xkDh.d.ts +202 -0
  51. package/dist/pres-C5__xkDh.d.ts.map +1 -0
  52. package/dist/presentation-Cp7vzlAw.js +5427 -0
  53. package/dist/presentation-Cp7vzlAw.js.map +1 -0
  54. package/dist/presentation-types-DP_8jog7.d.ts +4872 -0
  55. package/dist/presentation-types-DP_8jog7.d.ts.map +1 -0
  56. package/dist/read.d.ts +55 -0
  57. package/dist/read.d.ts.map +1 -0
  58. package/dist/read.js +4 -0
  59. package/dist/script.d.ts +581 -0
  60. package/dist/script.d.ts.map +1 -0
  61. package/dist/script.js +3741 -0
  62. package/dist/script.js.map +1 -0
  63. package/dist/shapes-BemroU-z.js +6951 -0
  64. package/dist/shapes-BemroU-z.js.map +1 -0
  65. package/dist/slide-js0QpRV-.d.ts +3873 -0
  66. package/dist/slide-js0QpRV-.d.ts.map +1 -0
  67. package/dist/text-CyetbF6p.js +11278 -0
  68. package/dist/text-CyetbF6p.js.map +1 -0
  69. package/dist/units-1kRzYShk.js +231 -0
  70. package/dist/units-1kRzYShk.js.map +1 -0
  71. package/dist/units-internal-Dg95w_YD.js +753 -0
  72. package/dist/units-internal-Dg95w_YD.js.map +1 -0
  73. package/dist/zip.d.ts +68 -0
  74. package/dist/zip.d.ts.map +1 -0
  75. package/dist/zip.js +163 -0
  76. package/dist/zip.js.map +1 -0
  77. package/package.json +152 -0
  78. package/skills/ts-pptx-upstream/SKILL.md +340 -0
@@ -0,0 +1,423 @@
1
+ import { r as EMU_PER_INCH, x as warn } from "./units-1kRzYShk.js";
2
+ import { D as DEF_SLIDE_MARGIN_IN, M as LINEH_MODIFIER, a as inch2Emu, i as getSmartParseNumber, s as marginToEmu } from "./units-internal-Dg95w_YD.js";
3
+ //#region src/gen/table/autopage.ts
4
+ /**
5
+ * Break cell text into lines based upon table column width (e.g.: Magic Happens Here(tm))
6
+ * @param {TableCell} cell - table cell
7
+ * @param {number} colWidth - table column width (inches)
8
+ * @param {boolean} [verbose] - dump the four wrapping stages; carries `addTable({ verbose })`
9
+ * down, which is the only stage of the pager that flag did not reach
10
+ * @return {TableRow[]} - cell's text objects grouped into lines
11
+ */
12
+ function parseTextToLines(cell, colWidth, verbose) {
13
+ const FOCO = 2.3 + (cell.options?.autoPageCharWeight ? cell.options.autoPageCharWeight : 0);
14
+ const CPL = Math.floor(colWidth * 72) / ((cell.options?.fontSize ? cell.options.fontSize : 12) / FOCO);
15
+ if (verbose) console.log(`[0/4] colWidth=${colWidth}in fontSize=${cell.options?.fontSize ?? 12} FOCO=${FOCO} CPL=${CPL}`);
16
+ const parsedLines = [];
17
+ let inputCells = [];
18
+ const inputLines1 = [];
19
+ const inputLines2 = [];
20
+ /**
21
+ * EX INPUTS: `cell.text`
22
+ * - string....: "Account Name Column"
23
+ * - object....: { text:"Account Name Column" }
24
+ * - object[]..: [{ text:"Account Name", options:{ bold:true } }, { text:" Column" }]
25
+ * - object[]..: [{ text:"Account Name", options:{ breakLine:true } }, { text:"Input" }]
26
+ */
27
+ /**
28
+ * EX OUTPUTS:
29
+ * - string....: [{ text:"Account Name Column" }]
30
+ * - object....: [{ text:"Account Name Column" }]
31
+ * - object[]..: [{ text:"Account Name", options:{ breakLine:true } }, { text:"Input" }]
32
+ * - object[]..: [{ text:"Account Name", options:{ breakLine:true } }, { text:"Input" }]
33
+ */
34
+ if (cell.text && cell.text.toString().trim().length === 0) inputCells.push({
35
+ _type: "tablecell",
36
+ text: " "
37
+ });
38
+ else if (typeof cell.text === "number" || typeof cell.text === "string") inputCells.push({
39
+ _type: "tablecell",
40
+ text: (cell.text || "").toString().trim()
41
+ });
42
+ else if (Array.isArray(cell.text)) inputCells = cell.text;
43
+ if (verbose) {
44
+ console.log("[1/4] inputCells");
45
+ inputCells.forEach((cell, idx) => console.log(`[1/4] [${idx + 1}] cell: ${JSON.stringify(cell)}`));
46
+ }
47
+ /**
48
+ * - EX: `[{ text:"Input Output" }, { text:"Extra" }]` == 1 line
49
+ * - EX: `[{ text:"Input" }, { text:"Output", options:{ breakLine:true } }]` == 1 line
50
+ * - EX: `[{ text:"Input\nOutput" }]` == 2 lines
51
+ * - EX: `[{ text:"Input", options:{ breakLine:true } }, { text:"Output" }]` == 2 lines
52
+ */
53
+ let newLine = [];
54
+ inputCells.forEach((cell) => {
55
+ if (typeof cell.text !== "string") return;
56
+ if (cell.text.includes("\n")) {
57
+ const parts = cell.text.split("\n");
58
+ parts.forEach((part, partIdx) => {
59
+ if (partIdx === parts.length - 1) newLine.push({
60
+ _type: "tablecell",
61
+ text: part,
62
+ options: cell.options
63
+ });
64
+ else {
65
+ newLine.push({
66
+ _type: "tablecell",
67
+ text: part,
68
+ options: {
69
+ ...cell.options,
70
+ breakLine: true
71
+ }
72
+ });
73
+ inputLines1.push(newLine);
74
+ newLine = [];
75
+ }
76
+ });
77
+ } else newLine.push({
78
+ _type: "tablecell",
79
+ text: cell.text.trim(),
80
+ options: cell.options
81
+ });
82
+ if (cell.options?.breakLine) {
83
+ if (verbose) console.log(`inputCells: new line > ${JSON.stringify(newLine)}`);
84
+ inputLines1.push(newLine);
85
+ newLine = [];
86
+ }
87
+ });
88
+ if (newLine.length > 0) {
89
+ inputLines1.push(newLine);
90
+ newLine = [];
91
+ }
92
+ if (verbose) {
93
+ console.log(`[2/4] inputLines1 (${inputLines1.length})`);
94
+ inputLines1.forEach((line, idx) => console.log(`[2/4] [${idx + 1}] line: ${JSON.stringify(line)}`));
95
+ }
96
+ inputLines1.forEach((line) => {
97
+ const lineTokens = [];
98
+ line.forEach((cell) => {
99
+ const lineWords = String(cell.text).split(" ");
100
+ lineWords.forEach((word, idx) => {
101
+ const cellProps = { ...cell.options };
102
+ if (cellProps?.breakLine) cellProps.breakLine = idx + 1 === lineWords.length;
103
+ lineTokens.push({
104
+ _type: "tablecell",
105
+ text: word + (idx + 1 < lineWords.length ? " " : ""),
106
+ options: cellProps
107
+ });
108
+ });
109
+ });
110
+ inputLines2.push(lineTokens);
111
+ });
112
+ if (verbose) {
113
+ console.log(`[3/4] inputLines2 (${inputLines2.length})`);
114
+ inputLines2.forEach((line) => console.log(`[3/4] line: ${JSON.stringify(line)}`));
115
+ }
116
+ inputLines2.forEach((line) => {
117
+ let lineCells = [];
118
+ let strCurrLine = "";
119
+ line.forEach((word) => {
120
+ const wordText = String(word.text || "");
121
+ if (strCurrLine.length + wordText.length > CPL) {
122
+ parsedLines.push(lineCells);
123
+ lineCells = [];
124
+ strCurrLine = "";
125
+ }
126
+ lineCells.push(word);
127
+ strCurrLine += wordText;
128
+ });
129
+ if (lineCells.length > 0) parsedLines.push(lineCells);
130
+ });
131
+ if (verbose) {
132
+ console.log(`[4/4] parsedLines (${parsedLines.length})`);
133
+ parsedLines.forEach((line, idx) => console.log(`[4/4] [Line ${idx + 1}]:\n${JSON.stringify(line)}`));
134
+ console.log("...............................................\n\n");
135
+ }
136
+ return parsedLines;
137
+ }
138
+ /**
139
+ * Takes an array of table rows and breaks into an array of slides, which contain the calculated amount of table rows that fit on that slide
140
+ * @param {TableCell[][]} tableRows - table rows
141
+ * @param {TableToSlidesProps} tableProps - table2slides properties
142
+ * @param {PresLayout} presLayout - presentation layout
143
+ * @param {SlideLayoutInternal} masterSlide - master slide
144
+ * @return {TableRowSlide[]} array of table rows
145
+ */
146
+ function getSlidesForTableRows(tableRows = [], tableProps = {}, presLayout, masterSlide) {
147
+ let arrInchMargins = DEF_SLIDE_MARGIN_IN;
148
+ let emuSlideTabW;
149
+ let emuSlideTabH = EMU_PER_INCH * 1;
150
+ let emuTabCurrH = 0;
151
+ let numCols = 0;
152
+ let warnedNoTabH = false;
153
+ const tableRowSlides = [];
154
+ const tablePropX = getSmartParseNumber(tableProps.x, "X", presLayout);
155
+ const tablePropY = getSmartParseNumber(tableProps.y, "Y", presLayout);
156
+ const tablePropW = getSmartParseNumber(tableProps.w, "X", presLayout);
157
+ const tablePropH = getSmartParseNumber(tableProps.h, "Y", presLayout);
158
+ let tableCalcW = tablePropW;
159
+ function calcSlideTabH() {
160
+ let emuStartY = 0;
161
+ if (tableRowSlides.length === 0) emuStartY = tablePropY || inch2Emu(arrInchMargins[0]);
162
+ if (tableRowSlides.length > 0) emuStartY = inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0]);
163
+ emuSlideTabH = (tablePropH || presLayout.height) - emuStartY - inch2Emu(arrInchMargins[2]);
164
+ if (tableRowSlides.length === 0 && tablePropH && emuSlideTabH < tablePropH) emuSlideTabH = tablePropH;
165
+ if (tableRowSlides.length > 1) {
166
+ if (typeof tableProps.autoPageSlideStartY === "number") emuSlideTabH = (tablePropH || presLayout.height) - inch2Emu(tableProps.autoPageSlideStartY + arrInchMargins[2]);
167
+ else if (tablePropY) {
168
+ emuSlideTabH = (tablePropH || presLayout.height) - inch2Emu((tablePropY / 914400 < arrInchMargins[0] ? tablePropY / EMU_PER_INCH : arrInchMargins[0]) + arrInchMargins[2]);
169
+ if (emuSlideTabH < tablePropH) emuSlideTabH = tablePropH;
170
+ }
171
+ }
172
+ const emuBaseLineH = inch2Emu((typeof tableProps.fontSize === "number" ? tableProps.fontSize : 12) * (LINEH_MODIFIER + (tableProps.autoPageLineWeight || 0)) / 100);
173
+ if (emuSlideTabH < emuBaseLineH) {
174
+ const emuStartY = tableRowSlides.length === 0 ? tablePropY || inch2Emu(arrInchMargins[0]) : inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0]);
175
+ const fallbackH = presLayout.height - emuStartY - inch2Emu(arrInchMargins[2]);
176
+ if (!warnedNoTabH) {
177
+ warn("table/autopage-height-too-small", "addTable/autoPage: the table height (`h`) leaves no room to paginate; ignoring it and using the slide height. Increase `h` or decrease `y`.");
178
+ warnedNoTabH = true;
179
+ }
180
+ emuSlideTabH = fallbackH > 0 ? fallbackH : presLayout.height;
181
+ }
182
+ }
183
+ if (tableProps.verbose) {
184
+ console.log("[[VERBOSE MODE]]");
185
+ console.log("|-- TABLE PROPS --------------------------------------------------------|");
186
+ console.log(`| presLayout.width ................................ = ${(presLayout.width / EMU_PER_INCH).toFixed(1)}`);
187
+ console.log(`| presLayout.height ............................... = ${(presLayout.height / EMU_PER_INCH).toFixed(1)}`);
188
+ console.log(`| tableProps.x .................................... = ${typeof tableProps.x === "number" ? (tableProps.x / EMU_PER_INCH).toFixed(1) : tableProps.x}`);
189
+ console.log(`| tableProps.y .................................... = ${typeof tableProps.y === "number" ? (tableProps.y / EMU_PER_INCH).toFixed(1) : tableProps.y}`);
190
+ console.log(`| tableProps.w .................................... = ${typeof tableProps.w === "number" ? (tableProps.w / EMU_PER_INCH).toFixed(1) : tableProps.w}`);
191
+ console.log(`| tableProps.h .................................... = ${typeof tableProps.h === "number" ? (tableProps.h / EMU_PER_INCH).toFixed(1) : tableProps.h}`);
192
+ console.log(`| tableProps.slideMargin .......................... = ${tableProps.slideMargin ? String(tableProps.slideMargin) : ""}`);
193
+ console.log(`| tableProps.margin ............................... = ${String(tableProps.margin)}`);
194
+ console.log(`| tableProps.colW ................................. = ${String(tableProps.colW)}`);
195
+ console.log(`| tableProps.autoPageSlideStartY .................. = ${tableProps.autoPageSlideStartY}`);
196
+ console.log(`| tableProps.autoPageCharWeight ................... = ${tableProps.autoPageCharWeight}`);
197
+ console.log("|-- CALCULATIONS -------------------------------------------------------|");
198
+ console.log(`| tablePropX ...................................... = ${tablePropX / EMU_PER_INCH}`);
199
+ console.log(`| tablePropY ...................................... = ${tablePropY / EMU_PER_INCH}`);
200
+ console.log(`| tablePropW ...................................... = ${tablePropW / EMU_PER_INCH}`);
201
+ console.log(`| tablePropH ...................................... = ${tablePropH / EMU_PER_INCH}`);
202
+ console.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`);
203
+ }
204
+ if (!tableProps.slideMargin && tableProps.slideMargin !== 0) tableProps.slideMargin = DEF_SLIDE_MARGIN_IN[0];
205
+ if (masterSlide && typeof masterSlide._margin !== "undefined") {
206
+ if (Array.isArray(masterSlide._margin)) arrInchMargins = masterSlide._margin;
207
+ else if (!isNaN(Number(masterSlide._margin))) arrInchMargins = [
208
+ Number(masterSlide._margin),
209
+ Number(masterSlide._margin),
210
+ Number(masterSlide._margin),
211
+ Number(masterSlide._margin)
212
+ ];
213
+ } else if (tableProps.slideMargin || tableProps.slideMargin === 0) {
214
+ if (Array.isArray(tableProps.slideMargin)) arrInchMargins = tableProps.slideMargin;
215
+ else if (!isNaN(tableProps.slideMargin)) arrInchMargins = [
216
+ tableProps.slideMargin,
217
+ tableProps.slideMargin,
218
+ tableProps.slideMargin,
219
+ tableProps.slideMargin
220
+ ];
221
+ }
222
+ if (tableProps.verbose) console.log(`| arrInchMargins .................................. = [${arrInchMargins.join(", ")}]`);
223
+ (tableRows[0] || []).forEach((cell) => {
224
+ if (!cell) cell = { _type: "tablecell" };
225
+ const cellOpts = cell.options || null;
226
+ numCols += Number(cellOpts?.colspan ? cellOpts.colspan : 1);
227
+ });
228
+ if (tableProps.verbose) console.log(`| numCols ......................................... = ${numCols}`);
229
+ const colSpanDepths = new Array(numCols).fill(0);
230
+ if (!tablePropW && tableProps.colW) {
231
+ tableCalcW = Array.isArray(tableProps.colW) ? tableProps.colW.reduce((p, n) => p + n) * EMU_PER_INCH : tableProps.colW * numCols || 0;
232
+ if (tableProps.verbose) console.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`);
233
+ }
234
+ emuSlideTabW = tableCalcW || inch2Emu((tablePropX ? tablePropX / 914400 : arrInchMargins[1]) + arrInchMargins[3]);
235
+ if (tableProps.verbose) console.log(`| emuSlideTabW .................................... = ${(emuSlideTabW / EMU_PER_INCH).toFixed(1)}`);
236
+ if (!tableProps.colW || !Array.isArray(tableProps.colW)) {
237
+ if (tableProps.colW && !isNaN(Number(tableProps.colW))) {
238
+ const arrColW = [];
239
+ const colW = Number(tableProps.colW);
240
+ (tableRows[0] || []).forEach(() => arrColW.push(colW));
241
+ tableProps.colW = [];
242
+ arrColW.forEach((val) => {
243
+ if (Array.isArray(tableProps.colW)) tableProps.colW.push(val);
244
+ });
245
+ } else {
246
+ tableProps.colW = [];
247
+ for (let iCol = 0; iCol < numCols; iCol++) tableProps.colW.push(emuSlideTabW / EMU_PER_INCH / numCols);
248
+ }
249
+ }
250
+ const resolveRowH = (origRowIdx) => Array.isArray(tableProps.rowH) && typeof tableProps.rowH[origRowIdx] === "number" ? tableProps.rowH[origRowIdx] : void 0;
251
+ let newTableRowSlide = {
252
+ rows: [],
253
+ rowH: []
254
+ };
255
+ tableRows.forEach((row, iRow) => {
256
+ const hasActiveRowSpan = colSpanDepths.some((d) => d > 0);
257
+ const rowCellLines = [];
258
+ let maxCellMarTopEmu = 0;
259
+ let maxCellMarBtmEmu = 0;
260
+ let currTableRow = [];
261
+ row.forEach((cell) => {
262
+ currTableRow.push({
263
+ _type: "tablecell",
264
+ text: [],
265
+ options: cell.options
266
+ });
267
+ const cellMargin = Array.isArray(cell.options?.margin) ? cell.options.margin : void 0;
268
+ const tableMargin = Array.isArray(tableProps.margin) ? tableProps.margin : null;
269
+ if (cellMargin?.[0] && marginToEmu(cellMargin[0]) > maxCellMarTopEmu) maxCellMarTopEmu = marginToEmu(cellMargin[0]);
270
+ else if (tableMargin?.[0] && marginToEmu(tableMargin[0]) > maxCellMarTopEmu) maxCellMarTopEmu = marginToEmu(tableMargin[0]);
271
+ if (cellMargin?.[2] && marginToEmu(cellMargin[2]) > maxCellMarBtmEmu) maxCellMarBtmEmu = marginToEmu(cellMargin[2]);
272
+ else if (tableMargin?.[2] && marginToEmu(tableMargin[2]) > maxCellMarBtmEmu) maxCellMarBtmEmu = marginToEmu(tableMargin[2]);
273
+ });
274
+ calcSlideTabH();
275
+ emuTabCurrH += maxCellMarTopEmu + maxCellMarBtmEmu;
276
+ if (tableProps.verbose && iRow === 0) console.log(`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `);
277
+ row.forEach((cell, iCell) => {
278
+ const newCellOptions = cell.options || {};
279
+ const newCell = {
280
+ _type: "tablecell",
281
+ _lines: [],
282
+ _lineHeight: inch2Emu((cell.options?.fontSize ? cell.options.fontSize : tableProps.fontSize ? tableProps.fontSize : 12) * (LINEH_MODIFIER + (tableProps.autoPageLineWeight ? tableProps.autoPageLineWeight : 0)) / 100),
283
+ text: [],
284
+ options: newCellOptions
285
+ };
286
+ if (newCellOptions.rowspan) newCell._lineHeight = 0;
287
+ newCellOptions.autoPageCharWeight = tableProps.autoPageCharWeight || void 0;
288
+ const tableColW = Array.isArray(tableProps.colW) ? tableProps.colW : [];
289
+ let totalColW = tableColW[iCell] ?? 0;
290
+ const cellColspan = cell.options?.colspan;
291
+ if (cellColspan) totalColW = tableColW.filter((_cell, idx) => idx >= iCell && idx < idx + cellColspan).reduce((prev, curr) => prev + curr);
292
+ newCell._lines = parseTextToLines(cell, totalColW, tableProps.verbose);
293
+ rowCellLines.push(newCell);
294
+ });
295
+ /** E: --==[[ PAGE DATA SET ]]==--
296
+ * Add text one-line-a-time to this row's cells until: lines are exhausted OR table height limit is hit
297
+ *
298
+ * Design:
299
+ * - Building cells L-to-R/loop style wont work as one could be 100 lines and another 1 line
300
+ * - Therefore, build the whole row, one-line-at-a-time, across each table columns
301
+ * - Then, when the vertical size limit is hit is by any of the cells, make a new slide and continue adding any remaining lines
302
+ *
303
+ * Implementation:
304
+ * - `rowCellLines` is an array of cells, one for each column in the table, with each cell containing an array of lines
305
+ *
306
+ * Sample Data:
307
+ * - `rowCellLines` ..: [ TableCell, TableCell, TableCell ]
308
+ * - `TableCell` .....: { _type: 'tablecell', _lines: TableCell[], _lineHeight: 10 }
309
+ * - `_lines` ........: [ {_type: 'tablecell', text: 'cell-1,line-1', options: {…}}, {_type: 'tablecell', text: 'cell-1,line-2', options: {…}} }
310
+ * - `_lines` is TableCell[] (the 1-N words in the line)
311
+ * {
312
+ * _lines: [{ text:'cell-1,line-1' }, { text:'cell-1,line-2' }], // TOTAL-CELL-HEIGHT = 2
313
+ * _lines: [{ text:'cell-2,line-1' }, { text:'cell-2,line-2' }], // TOTAL-CELL-HEIGHT = 2
314
+ * _lines: [{ text:'cell-3,line-1' }, { text:'cell-3,line-2' }, { text:'cell-3,line-3' }, { text:'cell-3,line-4' }], // TOTAL-CELL-HEIGHT = 4
315
+ * }
316
+ *
317
+ * Example: 2 rows, with the firstrow overflowing onto a new slide
318
+ * SLIDE 1:
319
+ * |--------|--------|--------|--------|
320
+ * | line-1 | line-1 | line-1 | line-1 |
321
+ * | | | line-2 | |
322
+ * | | | line-3 | |
323
+ * |--------|--------|--------|--------|
324
+ *
325
+ * SLIDE 2:
326
+ * |--------|--------|--------|--------|
327
+ * | | | line-4 | |
328
+ * |--------|--------|--------|--------|
329
+ * | line-1 | line-1 | line-1 | line-1 |
330
+ * |--------|--------|--------|--------|
331
+ */
332
+ if (tableProps.verbose) console.log(`\n| SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: START...`);
333
+ let currCellIdx = 0;
334
+ let emuLineMaxH = 0;
335
+ let isDone = false;
336
+ while (!isDone) {
337
+ const srcCell = rowCellLines[currCellIdx];
338
+ if (!srcCell) break;
339
+ let tgtCell = currTableRow[currCellIdx];
340
+ rowCellLines.forEach((cell) => {
341
+ if (cell._lineHeight >= emuLineMaxH) emuLineMaxH = cell._lineHeight;
342
+ });
343
+ if (emuTabCurrH + emuLineMaxH > emuSlideTabH && !hasActiveRowSpan) {
344
+ if (tableProps.verbose) {
345
+ console.log("\n|-----------------------------------------------------------------------|");
346
+ console.log(`|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} + ${(srcCell._lineHeight / EMU_PER_INCH).toFixed(2)} > ${emuSlideTabH / EMU_PER_INCH}`);
347
+ console.log("|-----------------------------------------------------------------------|\n\n");
348
+ }
349
+ if (currTableRow.length > 0 && currTableRow.map((cell) => Array.isArray(cell.text) ? cell.text.length : 0).reduce((p, n) => p + n) > 0) {
350
+ newTableRowSlide.rows.push(currTableRow);
351
+ newTableRowSlide.rowH?.push(resolveRowH(iRow));
352
+ }
353
+ if (newTableRowSlide.rows.length > 0) tableRowSlides.push(newTableRowSlide);
354
+ newTableRowSlide = {
355
+ rows: [],
356
+ rowH: []
357
+ };
358
+ currTableRow = [];
359
+ row.forEach((cell) => currTableRow.push({
360
+ _type: "tablecell",
361
+ text: [],
362
+ options: cell.options
363
+ }));
364
+ calcSlideTabH();
365
+ emuTabCurrH = maxCellMarTopEmu + maxCellMarBtmEmu;
366
+ if (tableProps.verbose) console.log(`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `);
367
+ if (tableProps.autoPageRepeatHeader && tableProps._arrObjTabHeadRows) tableProps._arrObjTabHeadRows.forEach((row, headIdx) => {
368
+ const newHeadRow = [];
369
+ let maxLineHeight = 0;
370
+ row.forEach((cell) => {
371
+ newHeadRow.push(cell);
372
+ if ((cell._lineHeight || 0) > maxLineHeight) maxLineHeight = cell._lineHeight || 0;
373
+ });
374
+ newTableRowSlide.rows.push(newHeadRow);
375
+ newTableRowSlide.rowH?.push(resolveRowH(headIdx));
376
+ emuTabCurrH += maxLineHeight;
377
+ });
378
+ tgtCell = currTableRow[currCellIdx];
379
+ }
380
+ const currLine = srcCell._lines.shift();
381
+ if (tgtCell && Array.isArray(tgtCell.text)) {
382
+ if (currLine) tgtCell.text = tgtCell.text.concat(currLine);
383
+ else if (tgtCell.text.length === 0) tgtCell.text = tgtCell.text.concat({
384
+ _type: "tablecell",
385
+ text: ""
386
+ });
387
+ }
388
+ if (currCellIdx === rowCellLines.length - 1) emuTabCurrH += emuLineMaxH;
389
+ currCellIdx = currCellIdx < rowCellLines.length - 1 ? currCellIdx + 1 : 0;
390
+ if (rowCellLines.map((cell) => cell._lines.length).reduce((prev, next) => prev + next) === 0) isDone = true;
391
+ }
392
+ if (currTableRow.length > 0) {
393
+ newTableRowSlide.rows.push(currTableRow);
394
+ newTableRowSlide.rowH?.push(resolveRowH(iRow));
395
+ }
396
+ const occupiedBefore = [...colSpanDepths];
397
+ let colCursor = 0;
398
+ row.forEach((cell) => {
399
+ while (colCursor < numCols && (occupiedBefore[colCursor] ?? 0) > 0) colCursor++;
400
+ const cellColspan = cell.options?.colspan ?? 1;
401
+ const cellRowspan = cell.options?.rowspan ?? 1;
402
+ if (cellRowspan > 1) for (let c = 0; c < cellColspan && colCursor + c < numCols; c++) colSpanDepths[colCursor + c] = cellRowspan;
403
+ colCursor += cellColspan;
404
+ });
405
+ for (let c = 0; c < numCols; c++) {
406
+ const depth = colSpanDepths[c] ?? 0;
407
+ if (depth > 0) colSpanDepths[c] = depth - 1;
408
+ }
409
+ if (tableProps.verbose) console.log(`- SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: ...COMPLETE ...... emuTabCurrH = ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} ( emuSlideTabH = ${(emuSlideTabH / EMU_PER_INCH).toFixed(2)} )`);
410
+ });
411
+ if (newTableRowSlide.rows.length > 0 || tableRowSlides.length === 0) tableRowSlides.push(newTableRowSlide);
412
+ if (tableProps.verbose) {
413
+ console.log("\n|================================================|");
414
+ console.log(`| FINAL: tableRowSlides.length = ${tableRowSlides.length}`);
415
+ tableRowSlides.forEach((slide) => console.log(slide));
416
+ console.log("|================================================|\n\n");
417
+ }
418
+ return tableRowSlides;
419
+ }
420
+ //#endregion
421
+ export { getSlidesForTableRows as t };
422
+
423
+ //# sourceMappingURL=autopage-DkjYZUFD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autopage-DkjYZUFD.js","names":[],"sources":["../src/gen/table/autopage.ts"],"sourcesContent":["/**\n * ts-pptx: Table auto-paging core\n *\n * The DOM-independent heart of table generation: given rows that overflow a slide,\n * split them across as many slides as needed, measuring wrapped text to compute line\n * counts and row heights. `getSlidesForTableRows` is the in-memory core (fully\n * Node-testable); `parseTextToLines` is its private cell-wrapping helper.\n */\n\nimport { SlideObjectType } from '../../enums.js'\nimport { DEF_FONT_SIZE, DEF_SLIDE_MARGIN_IN, LINEH_MODIFIER } from '../../constants-internal.js'\nimport type {\n\tPresLayout,\n\tTableCell,\n\tTableToSlidesProps,\n\tTableRow,\n\tTableRowSlide,\n\tTableCellProps,\n} from '../../types/index.js'\nimport type { SlideLayoutInternal } from '../../types/internal.js'\nimport { getSmartParseNumber, inch2Emu, marginToEmu } from '../../units-internal.js'\nimport { warn } from '../../diagnostics.js'\nimport { EMU_PER_INCH, POINTS_PER_INCH } from '../../units.js'\n\ntype AutoPageCell = TableCell & {\n\t_lineHeight: number\n\t_lines: TableCell[][]\n\toptions: TableCellProps\n\ttext: TableCell[]\n}\n\n// ===== Cell text wrapping =====\n\n/**\n * Break cell text into lines based upon table column width (e.g.: Magic Happens Here(tm))\n * @param {TableCell} cell - table cell\n * @param {number} colWidth - table column width (inches)\n * @param {boolean} [verbose] - dump the four wrapping stages; carries `addTable({ verbose })`\n * down, which is the only stage of the pager that flag did not reach\n * @return {TableRow[]} - cell's text objects grouped into lines\n */\nfunction parseTextToLines(cell: TableCell, colWidth: number, verbose?: boolean): TableCell[][] {\n\t// FYI: CPL = Width / (font-size / font-constant)\n\t// FYI: CHAR:2.3, colWidth:10, fontSize:12 => CPL=138, (actual chars per line in PPT)=145 [14.5 CPI]\n\t// FYI: CHAR:2.3, colWidth:7 , fontSize:12 => CPL= 97, (actual chars per line in PPT)=100 [14.3 CPI]\n\t// FYI: CHAR:2.3, colWidth:9 , fontSize:16 => CPL= 96, (actual chars per line in PPT)=84 [ 9.3 CPI]\n\tconst FOCO = 2.3 + (cell.options?.autoPageCharWeight ? cell.options.autoPageCharWeight : 0) // Character Constant\n\t// `colWidth` is inches, so the column's width in points is `colWidth * 72`. This used to be\n\t// spelled `(colWidth / EMU_PER_POINT) * EMU_PER_INCH`, which is the same 72 with two EMU\n\t// constants that cancel -- except that the detour through EMU is not exact in binary floating\n\t// point, and `Math.floor` takes the hit. Over the 200,000 widths from 0.001in to 200in the two\n\t// forms disagree on 51, always by one point low: 6.625in is exactly 477 points, and the old\n\t// form floored 476.9999... to 476.\n\tconst CPL =\n\t\tMath.floor(colWidth * POINTS_PER_INCH) / ((cell.options?.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / FOCO) // Chars-Per-Line\n\n\t// The number the four dumps below exist to explain: every wrap decision in step 4 is\n\t// `strCurrLine.length + word.length > CPL`, so a wrap that looks wrong is almost always\n\t// a CPL that is wrong, and CPL is not recoverable from the lines themselves.\n\tif (verbose)\n\t\tconsole.log(\n\t\t\t`[0/4] colWidth=${colWidth}in fontSize=${cell.options?.fontSize ?? DEF_FONT_SIZE} FOCO=${FOCO} CPL=${CPL}`\n\t\t)\n\n\tconst parsedLines: TableCell[][] = []\n\tlet inputCells: TableCell[] = []\n\tconst inputLines1: TableCell[][] = []\n\tconst inputLines2: TableCell[][] = []\n\n\t/**\n\t * EX INPUTS: `cell.text`\n\t * - string....: \"Account Name Column\"\n\t * - object....: { text:\"Account Name Column\" }\n\t * - object[]..: [{ text:\"Account Name\", options:{ bold:true } }, { text:\" Column\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t */\n\n\t/**\n\t * EX OUTPUTS:\n\t * - string....: [{ text:\"Account Name Column\" }]\n\t * - object....: [{ text:\"Account Name Column\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t * - object[]..: [{ text:\"Account Name\", options:{ breakLine:true } }, { text:\"Input\" }]\n\t */\n\n\t// STEP 1: Ensure inputCells is an array of TableCells\n\tif (cell.text && cell.text.toString().trim().length === 0) {\n\t\t// Allow a single space/whitespace as cell text (user-requested feature)\n\t\tinputCells.push({ _type: SlideObjectType.tablecell, text: ' ' })\n\t} else if (typeof cell.text === 'number' || typeof cell.text === 'string') {\n\t\tinputCells.push({ _type: SlideObjectType.tablecell, text: (cell.text || '').toString().trim() })\n\t} else if (Array.isArray(cell.text)) {\n\t\tinputCells = cell.text\n\t}\n\tif (verbose) {\n\t\tconsole.log('[1/4] inputCells')\n\t\tinputCells.forEach((cell, idx) => console.log(`[1/4] [${idx + 1}] cell: ${JSON.stringify(cell)}`))\n\t}\n\n\t// STEP 2: Group table cells into lines based on \"\\n\" or `breakLine` prop\n\t/**\n\t * - EX: `[{ text:\"Input Output\" }, { text:\"Extra\" }]` == 1 line\n\t * - EX: `[{ text:\"Input\" }, { text:\"Output\", options:{ breakLine:true } }]` == 1 line\n\t * - EX: `[{ text:\"Input\\nOutput\" }]` == 2 lines\n\t * - EX: `[{ text:\"Input\", options:{ breakLine:true } }, { text:\"Output\" }]` == 2 lines\n\t */\n\tlet newLine: TableCell[] = []\n\tinputCells.forEach((cell) => {\n\t\tif (typeof cell.text !== 'string') return\n\n\t\tif (cell.text.includes('\\n')) {\n\t\t\t// Each non-last \\n-split part ends with a forced paragraph break; the last\n\t\t\t// part accumulates in newLine so subsequent runs stay on the same paragraph.\n\t\t\tconst parts = cell.text.split('\\n')\n\t\t\tparts.forEach((part, partIdx) => {\n\t\t\t\tconst isLastPart = partIdx === parts.length - 1\n\t\t\t\tif (isLastPart) {\n\t\t\t\t\tnewLine.push({ _type: SlideObjectType.tablecell, text: part, options: cell.options })\n\t\t\t\t} else {\n\t\t\t\t\tnewLine.push({\n\t\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\t\ttext: part,\n\t\t\t\t\t\toptions: { ...cell.options, breakLine: true },\n\t\t\t\t\t})\n\t\t\t\t\tinputLines1.push(newLine)\n\t\t\t\t\tnewLine = []\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tnewLine.push({ _type: SlideObjectType.tablecell, text: cell.text.trim(), options: cell.options })\n\t\t}\n\n\t\tif (cell.options?.breakLine) {\n\t\t\tif (verbose) console.log(`inputCells: new line > ${JSON.stringify(newLine)}`)\n\t\t\tinputLines1.push(newLine)\n\t\t\tnewLine = []\n\t\t}\n\t})\n\t// Flush remaining buffer after all cells are processed\n\tif (newLine.length > 0) {\n\t\tinputLines1.push(newLine)\n\t\tnewLine = []\n\t}\n\tif (verbose) {\n\t\tconsole.log(`[2/4] inputLines1 (${inputLines1.length})`)\n\t\tinputLines1.forEach((line, idx) => console.log(`[2/4] [${idx + 1}] line: ${JSON.stringify(line)}`))\n\t}\n\n\t// STEP 3: Tokenize every text object into words. All runs of one logical paragraph\n\t// are flattened into a single token list so step 4 tracks column position across\n\t// styled-run boundaries (fixes independent-reset bug for rich-text cells).\n\tinputLines1.forEach((line) => {\n\t\tconst lineTokens: TableCell[] = []\n\t\tline.forEach((cell) => {\n\t\t\tconst cellTextStr = String(cell.text) // force convert to string (compiled JS is better with this than a cast)\n\t\t\tconst lineWords = cellTextStr.split(' ')\n\n\t\t\tlineWords.forEach((word, idx) => {\n\t\t\t\tconst cellProps = { ...cell.options }\n\t\t\t\t// IMPORTANT: Handle `breakLine` prop - we cannot apply to each word - only apply to very last word!\n\t\t\t\tif (cellProps?.breakLine) cellProps.breakLine = idx + 1 === lineWords.length\n\t\t\t\tlineTokens.push({\n\t\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t\ttext: word + (idx + 1 < lineWords.length ? ' ' : ''),\n\t\t\t\t\toptions: cellProps,\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t\tinputLines2.push(lineTokens)\n\t})\n\tif (verbose) {\n\t\tconsole.log(`[3/4] inputLines2 (${inputLines2.length})`)\n\t\tinputLines2.forEach((line) => console.log(`[3/4] line: ${JSON.stringify(line)}`))\n\t}\n\n\t// STEP 4: Group cells/words into lines based upon space consumed by word letters\n\tinputLines2.forEach((line) => {\n\t\tlet lineCells: TableCell[] = []\n\t\tlet strCurrLine = ''\n\n\t\tline.forEach((word) => {\n\t\t\tconst wordText = String(word.text || '')\n\t\t\t// A: create new line when horizontal space is exhausted\n\t\t\tif (strCurrLine.length + wordText.length > CPL) {\n\t\t\t\tparsedLines.push(lineCells)\n\t\t\t\tlineCells = []\n\t\t\t\tstrCurrLine = ''\n\t\t\t}\n\n\t\t\t// B: add current word to line cells\n\t\t\tlineCells.push(word)\n\n\t\t\t// C: add current word to `strCurrLine` which we use to keep track of line's char length\n\t\t\tstrCurrLine += wordText\n\t\t})\n\n\t\t// Flush buffer: Only create a line when there's text to avoid empty row\n\t\tif (lineCells.length > 0) parsedLines.push(lineCells)\n\t})\n\tif (verbose) {\n\t\tconsole.log(`[4/4] parsedLines (${parsedLines.length})`)\n\t\tparsedLines.forEach((line, idx) => console.log(`[4/4] [Line ${idx + 1}]:\\n${JSON.stringify(line)}`))\n\t\tconsole.log('...............................................\\n\\n')\n\t}\n\n\t// Done:\n\treturn parsedLines\n}\n\n// ===== Auto-page engine =====\n// The in-memory core (fully Node-testable). Internally signposted by the\n// `// STEP 1..7` markers below: margins → column count → widths → the main\n// row-iteration/overflow loop (STEP 6) → final-slide flush (STEP 7).\n\n/**\n * Takes an array of table rows and breaks into an array of slides, which contain the calculated amount of table rows that fit on that slide\n * @param {TableCell[][]} tableRows - table rows\n * @param {TableToSlidesProps} tableProps - table2slides properties\n * @param {PresLayout} presLayout - presentation layout\n * @param {SlideLayoutInternal} masterSlide - master slide\n * @return {TableRowSlide[]} array of table rows\n */\nexport function getSlidesForTableRows(\n\ttableRows: TableCell[][] = [],\n\ttableProps: TableToSlidesProps = {},\n\tpresLayout: PresLayout,\n\tmasterSlide?: SlideLayoutInternal | null\n): TableRowSlide[] {\n\tlet arrInchMargins = DEF_SLIDE_MARGIN_IN\n\tlet emuSlideTabW: number\n\tlet emuSlideTabH = EMU_PER_INCH * 1\n\tlet emuTabCurrH = 0\n\tlet numCols = 0\n\tlet warnedNoTabH = false\n\tconst tableRowSlides: TableRowSlide[] = []\n\tconst tablePropX = getSmartParseNumber(tableProps.x, 'X', presLayout)\n\tconst tablePropY = getSmartParseNumber(tableProps.y, 'Y', presLayout)\n\tconst tablePropW = getSmartParseNumber(tableProps.w, 'X', presLayout)\n\tconst tablePropH = getSmartParseNumber(tableProps.h, 'Y', presLayout)\n\tlet tableCalcW: number = tablePropW\n\n\tfunction calcSlideTabH(): void {\n\t\tlet emuStartY = 0\n\t\tif (tableRowSlides.length === 0) emuStartY = tablePropY || inch2Emu(arrInchMargins[0])\n\t\tif (tableRowSlides.length > 0) emuStartY = inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0])\n\t\temuSlideTabH = (tablePropH || presLayout.height) - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t// EXPLICIT-H FIX: an explicit `h` is the table's height (an extent), not a\n\t\t// bottom coordinate, so — unlike `presLayout.height` — the first slide must NOT subtract the\n\t\t// start-Y from it. Otherwise a table that begins mid-slide gets a tiny first page (only a few\n\t\t// rows) while later pages, which already clamp to `h`, render normally. Mirror the\n\t\t// subsequent-slide rule below: never let an explicit `h` shrink the usable height below `h`.\n\t\tif (tableRowSlides.length === 0 && tablePropH && emuSlideTabH < tablePropH) emuSlideTabH = tablePropH\n\t\tif (tableRowSlides.length > 1) {\n\t\t\t// D: RULE: Use margins for starting point after the initial Slide, not `opt.y`\n\t\t\tif (typeof tableProps.autoPageSlideStartY === 'number') {\n\t\t\t\temuSlideTabH = (tablePropH || presLayout.height) - inch2Emu(tableProps.autoPageSlideStartY + arrInchMargins[2])\n\t\t\t} else if (tablePropY) {\n\t\t\t\temuSlideTabH =\n\t\t\t\t\t(tablePropH || presLayout.height) -\n\t\t\t\t\tinch2Emu(\n\t\t\t\t\t\t(tablePropY / EMU_PER_INCH < arrInchMargins[0] ? tablePropY / EMU_PER_INCH : arrInchMargins[0]) +\n\t\t\t\t\t\t\tarrInchMargins[2]\n\t\t\t\t\t)\n\t\t\t\t// Use whichever is greater: area between margins or the table H provided (dont shrink usable area - the whole point of over-riding Y on paging is to *increase* usable space)\n\t\t\t\tif (emuSlideTabH < tablePropH) emuSlideTabH = tablePropH\n\t\t\t}\n\t\t}\n\n\t\t// GUARD: a non-positive height, or one too small to fit even a single line of the base font,\n\t\t// means no row ever fits. That previously emitted degenerate empty overflow pages (rows:[]),\n\t\t// which made the recursive addTable throw \"Array expected\", or — with `h` smaller than one\n\t\t// line — placed one row per slide forever. Ignore the unusable height, fall back to the full\n\t\t// slide area between margins, and warn once rather than emit a broken table.\n\t\tconst emuBaseLineH = inch2Emu(\n\t\t\t((typeof tableProps.fontSize === 'number' ? tableProps.fontSize : DEF_FONT_SIZE) *\n\t\t\t\t(LINEH_MODIFIER + (tableProps.autoPageLineWeight || 0))) /\n\t\t\t\t100\n\t\t)\n\t\tif (emuSlideTabH < emuBaseLineH) {\n\t\t\tconst emuStartY =\n\t\t\t\ttableRowSlides.length === 0\n\t\t\t\t\t? tablePropY || inch2Emu(arrInchMargins[0])\n\t\t\t\t\t: inch2Emu(tableProps.autoPageSlideStartY || arrInchMargins[0])\n\t\t\tconst fallbackH = presLayout.height - emuStartY - inch2Emu(arrInchMargins[2])\n\t\t\tif (!warnedNoTabH) {\n\t\t\t\twarn(\n\t\t\t\t\t'table/autopage-height-too-small',\n\t\t\t\t\t'addTable/autoPage: the table height (`h`) leaves no room to paginate; ignoring it and using the slide height. Increase `h` or decrease `y`.'\n\t\t\t\t)\n\t\t\t\twarnedNoTabH = true\n\t\t\t}\n\t\t\temuSlideTabH = fallbackH > 0 ? fallbackH : presLayout.height\n\t\t}\n\t}\n\n\tif (tableProps.verbose) {\n\t\tconsole.log('[[VERBOSE MODE]]')\n\t\tconsole.log('|-- TABLE PROPS --------------------------------------------------------|')\n\t\tconsole.log(`| presLayout.width ................................ = ${(presLayout.width / EMU_PER_INCH).toFixed(1)}`)\n\t\tconsole.log(\n\t\t\t`| presLayout.height ............................... = ${(presLayout.height / EMU_PER_INCH).toFixed(1)}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.x .................................... = ${typeof tableProps.x === 'number' ? (tableProps.x / EMU_PER_INCH).toFixed(1) : tableProps.x}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.y .................................... = ${typeof tableProps.y === 'number' ? (tableProps.y / EMU_PER_INCH).toFixed(1) : tableProps.y}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.w .................................... = ${typeof tableProps.w === 'number' ? (tableProps.w / EMU_PER_INCH).toFixed(1) : tableProps.w}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.h .................................... = ${typeof tableProps.h === 'number' ? (tableProps.h / EMU_PER_INCH).toFixed(1) : tableProps.h}`\n\t\t)\n\t\tconsole.log(\n\t\t\t`| tableProps.slideMargin .......................... = ${tableProps.slideMargin ? String(tableProps.slideMargin) : ''}`\n\t\t)\n\t\tconsole.log(`| tableProps.margin ............................... = ${String(tableProps.margin)}`)\n\t\tconsole.log(`| tableProps.colW ................................. = ${String(tableProps.colW)}`)\n\t\tconsole.log(`| tableProps.autoPageSlideStartY .................. = ${tableProps.autoPageSlideStartY}`)\n\t\tconsole.log(`| tableProps.autoPageCharWeight ................... = ${tableProps.autoPageCharWeight}`)\n\t\tconsole.log('|-- CALCULATIONS -------------------------------------------------------|')\n\t\tconsole.log(`| tablePropX ...................................... = ${tablePropX / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropY ...................................... = ${tablePropY / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropW ...................................... = ${tablePropW / EMU_PER_INCH}`)\n\t\tconsole.log(`| tablePropH ...................................... = ${tablePropH / EMU_PER_INCH}`)\n\t\tconsole.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`)\n\t}\n\n\t// STEP 1: Calculate margins\n\t{\n\t\t// Important: Use default size as zero cell margin is causing our tables to be too large and touch bottom of slide!\n\t\tif (!tableProps.slideMargin && tableProps.slideMargin !== 0) tableProps.slideMargin = DEF_SLIDE_MARGIN_IN[0]\n\n\t\tif (masterSlide && typeof masterSlide._margin !== 'undefined') {\n\t\t\tif (Array.isArray(masterSlide._margin)) arrInchMargins = masterSlide._margin\n\t\t\telse if (!isNaN(Number(masterSlide._margin))) {\n\t\t\t\tarrInchMargins = [\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t\tNumber(masterSlide._margin),\n\t\t\t\t]\n\t\t\t}\n\t\t} else if (tableProps.slideMargin || tableProps.slideMargin === 0) {\n\t\t\tif (Array.isArray(tableProps.slideMargin)) arrInchMargins = tableProps.slideMargin\n\t\t\telse if (!isNaN(tableProps.slideMargin))\n\t\t\t\tarrInchMargins = [\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t\ttableProps.slideMargin,\n\t\t\t\t]\n\t\t}\n\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| arrInchMargins .................................. = [${arrInchMargins.join(', ')}]`)\n\t}\n\n\t// STEP 2: Calculate number of columns\n\t{\n\t\t// NOTE: Cells may have a colspan, so merely taking the length of the [0] (or any other) row is not\n\t\t// ....: sufficient to determine column count. Therefore, check each cell for a colspan and total cols as reqd\n\t\tconst firstRow = tableRows[0] || []\n\t\tfirstRow.forEach((cell) => {\n\t\t\tif (!cell) cell = { _type: SlideObjectType.tablecell }\n\t\t\tconst cellOpts = cell.options || null\n\t\t\tnumCols += Number(cellOpts?.colspan ? cellOpts.colspan : 1)\n\t\t})\n\t\tif (tableProps.verbose) console.log(`| numCols ......................................... = ${numCols}`)\n\t}\n\n\t// Track per-column remaining rowspan depths so we can suppress page breaks that would\n\t// fall inside a rowspan group. colSpanDepths[c] = how many more rows column c is still\n\t// occupied by a rowspan that started in a previous row.\n\tconst colSpanDepths: number[] = new Array<number>(numCols).fill(0)\n\n\t// STEP 3: Calculate width using tableProps.colW if possible\n\tif (!tablePropW && tableProps.colW) {\n\t\ttableCalcW = Array.isArray(tableProps.colW)\n\t\t\t? tableProps.colW.reduce((p, n) => p + n) * EMU_PER_INCH\n\t\t\t: tableProps.colW * numCols || 0\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| tableCalcW ...................................... = ${tableCalcW / EMU_PER_INCH}`)\n\t}\n\n\t// STEP 4: Calculate usable width now that total usable space is known (`emuSlideTabW`)\n\t{\n\t\temuSlideTabW =\n\t\t\ttableCalcW || inch2Emu((tablePropX ? tablePropX / EMU_PER_INCH : arrInchMargins[1]) + arrInchMargins[3])\n\t\tif (tableProps.verbose)\n\t\t\tconsole.log(`| emuSlideTabW .................................... = ${(emuSlideTabW / EMU_PER_INCH).toFixed(1)}`)\n\t}\n\n\t// STEP 5: Calculate column widths if not provided (emuSlideTabW will be used below to determine lines-per-col)\n\tif (!tableProps.colW || !Array.isArray(tableProps.colW)) {\n\t\tif (tableProps.colW && !isNaN(Number(tableProps.colW))) {\n\t\t\tconst arrColW: number[] = []\n\t\t\tconst colW = Number(tableProps.colW)\n\t\t\tconst firstRow = tableRows[0] || []\n\t\t\tfirstRow.forEach(() => arrColW.push(colW))\n\t\t\ttableProps.colW = []\n\t\t\tarrColW.forEach((val) => {\n\t\t\t\tif (Array.isArray(tableProps.colW)) tableProps.colW.push(val)\n\t\t\t})\n\t\t} else {\n\t\t\t// No column widths provided? Then distribute cols.\n\t\t\ttableProps.colW = []\n\t\t\tfor (let iCol = 0; iCol < numCols; iCol++) {\n\t\t\t\ttableProps.colW.push(emuSlideTabW / EMU_PER_INCH / numCols)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Resolve a row's explicit height (inches) from the original `rowH` *array*, keyed by original\n\t// row index. A single-number `rowH` is left to propagate via table options (it applies uniformly,\n\t// so it needs no per-row remapping); only the array form is index-sensitive after pagination.\n\tconst resolveRowH = (origRowIdx: number): number | undefined =>\n\t\tArray.isArray(tableProps.rowH) && typeof tableProps.rowH[origRowIdx] === 'number'\n\t\t\t? tableProps.rowH[origRowIdx]\n\t\t\t: undefined\n\n\t// STEP 6: **MAIN** Iterate over rows, add table content, create new slides as rows overflow\n\tlet newTableRowSlide: TableRowSlide = { rows: [] as TableRow[], rowH: [] as Array<number | undefined> }\n\ttableRows.forEach((row, iRow) => {\n\t\t// A: Row variables — detect active rowspan at the start of this row so we can\n\t\t// suppress page breaks that would split a rowspan group across slides.\n\t\tconst hasActiveRowSpan = colSpanDepths.some((d) => d > 0)\n\t\tconst rowCellLines: AutoPageCell[] = []\n\t\tlet maxCellMarTopEmu = 0\n\t\tlet maxCellMarBtmEmu = 0\n\n\t\t// B: Create new row in data model, calc `maxCellMar*`\n\t\tlet currTableRow: TableRow = []\n\t\trow.forEach((cell) => {\n\t\t\tcurrTableRow.push({\n\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\ttext: [],\n\t\t\t\toptions: cell.options,\n\t\t\t})\n\n\t\t\t// Cell margins are inches (see `marginToEmu`); prefer the cell's own top/bottom margin, else the table's.\n\t\t\tconst cellMargin = Array.isArray(cell.options?.margin) ? cell.options.margin : undefined\n\t\t\tconst tableMargin = Array.isArray(tableProps.margin) ? tableProps.margin : null\n\t\t\tif (cellMargin?.[0] && marginToEmu(cellMargin[0]) > maxCellMarTopEmu)\n\t\t\t\tmaxCellMarTopEmu = marginToEmu(cellMargin[0])\n\t\t\telse if (tableMargin?.[0] && marginToEmu(tableMargin[0]) > maxCellMarTopEmu)\n\t\t\t\tmaxCellMarTopEmu = marginToEmu(tableMargin[0])\n\t\t\tif (cellMargin?.[2] && marginToEmu(cellMargin[2]) > maxCellMarBtmEmu)\n\t\t\t\tmaxCellMarBtmEmu = marginToEmu(cellMargin[2])\n\t\t\telse if (tableMargin?.[2] && marginToEmu(tableMargin[2]) > maxCellMarBtmEmu)\n\t\t\t\tmaxCellMarBtmEmu = marginToEmu(tableMargin[2])\n\t\t})\n\n\t\t// C: Calc usable vertical space/table height. Set default value first, adjust below when necessary.\n\t\tcalcSlideTabH()\n\t\temuTabCurrH += maxCellMarTopEmu + maxCellMarBtmEmu // Start row height with margins\n\t\tif (tableProps.verbose && iRow === 0)\n\t\t\tconsole.log(\n\t\t\t\t`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `\n\t\t\t)\n\n\t\t// D: --==[[ BUILD DATA SET ]]==-- (iterate over cells: split text into lines[], set `lineHeight`)\n\t\trow.forEach((cell, iCell) => {\n\t\t\tconst newCellOptions = cell.options || {}\n\t\t\tconst newCell: AutoPageCell = {\n\t\t\t\t_type: SlideObjectType.tablecell,\n\t\t\t\t_lines: [],\n\t\t\t\t_lineHeight: inch2Emu(\n\t\t\t\t\t((cell.options?.fontSize\n\t\t\t\t\t\t? cell.options.fontSize\n\t\t\t\t\t\t: tableProps.fontSize\n\t\t\t\t\t\t\t? tableProps.fontSize\n\t\t\t\t\t\t\t: DEF_FONT_SIZE) *\n\t\t\t\t\t\t(LINEH_MODIFIER + (tableProps.autoPageLineWeight ? tableProps.autoPageLineWeight : 0))) /\n\t\t\t\t\t\t100\n\t\t\t\t),\n\t\t\t\ttext: [],\n\t\t\t\toptions: newCellOptions,\n\t\t\t}\n\n\t\t\t// E-1: Exempt cells with `rowspan` from increasing lineHeight (or we could create a new slide when unecessary!)\n\t\t\tif (newCellOptions.rowspan) newCell._lineHeight = 0\n\n\t\t\t// E-2: The parseTextToLines method uses `autoPageCharWeight`, so inherit from table options\n\t\t\tnewCellOptions.autoPageCharWeight = tableProps.autoPageCharWeight || undefined\n\n\t\t\t// E-3: **MAIN** Parse cell contents into lines based upon col width, font, etc\n\t\t\tconst tableColW = Array.isArray(tableProps.colW) ? tableProps.colW : []\n\t\t\tlet totalColW = tableColW[iCell] ?? 0\n\t\t\tconst cellColspan = cell.options?.colspan\n\t\t\tif (cellColspan) {\n\t\t\t\ttotalColW = tableColW\n\t\t\t\t\t.filter((_cell, idx) => idx >= iCell && idx < idx + cellColspan)\n\t\t\t\t\t.reduce((prev, curr) => prev + curr)\n\t\t\t}\n\n\t\t\t// E-4: Create lines based upon available column width\n\t\t\tnewCell._lines = parseTextToLines(cell, totalColW, tableProps.verbose)\n\n\t\t\t// E-5: Add cell to array\n\t\t\trowCellLines.push(newCell)\n\t\t})\n\n\t\t/** E: --==[[ PAGE DATA SET ]]==--\n\t\t * Add text one-line-a-time to this row's cells until: lines are exhausted OR table height limit is hit\n\t\t *\n\t\t * Design:\n\t\t * - Building cells L-to-R/loop style wont work as one could be 100 lines and another 1 line\n\t\t * - Therefore, build the whole row, one-line-at-a-time, across each table columns\n\t\t * - Then, when the vertical size limit is hit is by any of the cells, make a new slide and continue adding any remaining lines\n\t\t *\n\t\t * Implementation:\n\t\t * - `rowCellLines` is an array of cells, one for each column in the table, with each cell containing an array of lines\n\t\t *\n\t\t * Sample Data:\n\t\t * - `rowCellLines` ..: [ TableCell, TableCell, TableCell ]\n\t\t * - `TableCell` .....: { _type: 'tablecell', _lines: TableCell[], _lineHeight: 10 }\n\t\t * - `_lines` ........: [ {_type: 'tablecell', text: 'cell-1,line-1', options: {…}}, {_type: 'tablecell', text: 'cell-1,line-2', options: {…}} }\n\t\t * - `_lines` is TableCell[] (the 1-N words in the line)\n\t\t * {\n\t\t * _lines: [{ text:'cell-1,line-1' }, { text:'cell-1,line-2' }], // TOTAL-CELL-HEIGHT = 2\n\t\t * _lines: [{ text:'cell-2,line-1' }, { text:'cell-2,line-2' }], // TOTAL-CELL-HEIGHT = 2\n\t\t * _lines: [{ text:'cell-3,line-1' }, { text:'cell-3,line-2' }, { text:'cell-3,line-3' }, { text:'cell-3,line-4' }], // TOTAL-CELL-HEIGHT = 4\n\t\t * }\n\t\t *\n\t\t * Example: 2 rows, with the firstrow overflowing onto a new slide\n\t\t * SLIDE 1:\n\t\t * |--------|--------|--------|--------|\n\t\t * | line-1 | line-1 | line-1 | line-1 |\n\t\t * | | | line-2 | |\n\t\t * | | | line-3 | |\n\t\t * |--------|--------|--------|--------|\n\t\t *\n\t\t * SLIDE 2:\n\t\t * |--------|--------|--------|--------|\n\t\t * | | | line-4 | |\n\t\t * |--------|--------|--------|--------|\n\t\t * | line-1 | line-1 | line-1 | line-1 |\n\t\t * |--------|--------|--------|--------|\n\t\t */\n\t\tif (tableProps.verbose) console.log(`\\n| SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: START...`)\n\t\tlet currCellIdx = 0\n\t\tlet emuLineMaxH = 0\n\t\tlet isDone = false\n\t\twhile (!isDone) {\n\t\t\tconst srcCell = rowCellLines[currCellIdx]\n\t\t\tif (!srcCell) break\n\t\t\tlet tgtCell = currTableRow[currCellIdx] // NOTE: may be redefined below (a new row may be created, thus changing this value)\n\n\t\t\t// 1: calc emuLineMaxH\n\t\t\trowCellLines.forEach((cell) => {\n\t\t\t\tif (cell._lineHeight >= emuLineMaxH) emuLineMaxH = cell._lineHeight\n\t\t\t})\n\n\t\t\t// 2: create a new slide if there is insufficient room for the current row,\n\t\t\t// but never break inside a rowspan group — keep spanned rows together.\n\t\t\tif (emuTabCurrH + emuLineMaxH > emuSlideTabH && !hasActiveRowSpan) {\n\t\t\t\tif (tableProps.verbose) {\n\t\t\t\t\tconsole.log('\\n|-----------------------------------------------------------------------|')\n\t\t\t\t\t// prettier-ignore\n\t\t\t\t\tconsole.log(`|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} + ${(srcCell._lineHeight / EMU_PER_INCH).toFixed(2)} > ${emuSlideTabH / EMU_PER_INCH}`)\n\t\t\t\t\tconsole.log('|-----------------------------------------------------------------------|\\n\\n')\n\t\t\t\t}\n\n\t\t\t\t// A: add current row slide or it will be lost (only if it has rows and text)\n\t\t\t\tif (\n\t\t\t\t\tcurrTableRow.length > 0 &&\n\t\t\t\t\tcurrTableRow.map((cell) => (Array.isArray(cell.text) ? cell.text.length : 0)).reduce((p, n) => p + n) > 0\n\t\t\t\t) {\n\t\t\t\t\tnewTableRowSlide.rows.push(currTableRow)\n\t\t\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(iRow))\n\t\t\t\t}\n\n\t\t\t\t// B: add current slide to Slides array (never push an empty page: a row that does not\n\t\t\t\t// fit yet has no content here, and an empty `rows` slide crashes the recursive addTable)\n\t\t\t\tif (newTableRowSlide.rows.length > 0) tableRowSlides.push(newTableRowSlide)\n\n\t\t\t\t// C: reset working/curr slide to hold rows as they're created\n\t\t\t\tconst newRows: TableRow[] = []\n\t\t\t\tnewTableRowSlide = { rows: newRows, rowH: [] as Array<number | undefined> }\n\n\t\t\t\t// D: reset working/curr row\n\t\t\t\tcurrTableRow = []\n\t\t\t\trow.forEach((cell) => currTableRow.push({ _type: SlideObjectType.tablecell, text: [], options: cell.options }))\n\n\t\t\t\t// E: Calc usable vertical space/table height now as we may still be in the same row and code above (\"C: Calc usable vertical space/table height.\") calc may now be invalid\n\t\t\t\tcalcSlideTabH()\n\n\t\t\t\t// F: reset current table height for this new Slide, then re-charge the row's cell\n\t\t\t\t// margins onto it — the row is starting over here, so it owes them again.\n\t\t\t\t//\n\t\t\t\t// ORDER IS LOAD-BEARING. These two statements used to run the other way round: the\n\t\t\t\t// margins were added and then wiped by the reset, so the first row of every\n\t\t\t\t// continuation slide was the only row in the table that paid no margin. That let a\n\t\t\t\t// continuation slide accept one row more than it had room for, and the extra row\n\t\t\t\t// hung off the bottom of the slide (upstream gitbrent/PptxGenJS#1200). The symptom\n\t\t\t\t// is easy to miss because the pager is *self*-consistent per slide: it only shows\n\t\t\t\t// up as the first slide and the continuation slides disagreeing about how many\n\t\t\t\t// identical rows fit the identical space — which is what\n\t\t\t\t// test/regression/table-autopage-continuation-budget.test.js pins.\n\t\t\t\temuTabCurrH = maxCellMarTopEmu + maxCellMarBtmEmu\n\t\t\t\tif (tableProps.verbose)\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `\n\t\t\t\t\t)\n\n\t\t\t\t// G: handle repeat headers option /or/ Add new empty row to continue current lines into\n\t\t\t\tif (tableProps.autoPageRepeatHeader && tableProps._arrObjTabHeadRows) {\n\t\t\t\t\ttableProps._arrObjTabHeadRows.forEach((row, headIdx) => {\n\t\t\t\t\t\tconst newHeadRow: TableRow = []\n\t\t\t\t\t\tlet maxLineHeight = 0\n\t\t\t\t\t\trow.forEach((cell) => {\n\t\t\t\t\t\t\tnewHeadRow.push(cell)\n\t\t\t\t\t\t\tif ((cell._lineHeight || 0) > maxLineHeight) maxLineHeight = cell._lineHeight || 0\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewTableRowSlide.rows.push(newHeadRow)\n\t\t\t\t\t\t// Repeated header rows are the original leading rows, so carry their configured height.\n\t\t\t\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(headIdx))\n\t\t\t\t\t\t// NOTE: possible imprecision — this accumulates line height only; cell top/bottom\n\t\t\t\t\t\t// margins are not added, so autoPage row-height estimates can run slightly short.\n\t\t\t\t\t\temuTabCurrH += maxLineHeight\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\t// WIP: NEW: TEST THIS!!\n\t\t\t\ttgtCell = currTableRow[currCellIdx]\n\t\t\t}\n\n\t\t\t// 3: set array of words that comprise this line\n\t\t\tconst currLine = srcCell._lines.shift()\n\n\t\t\t// 4: create new line by adding all words from curr line (or add empty if there are no words to avoid \"needs repair\" issue triggered when cells have null content)\n\t\t\tif (tgtCell && Array.isArray(tgtCell.text)) {\n\t\t\t\tif (currLine) tgtCell.text = tgtCell.text.concat(currLine)\n\t\t\t\telse if (tgtCell.text.length === 0)\n\t\t\t\t\ttgtCell.text = tgtCell.text.concat({ _type: SlideObjectType.tablecell, text: '' })\n\t\t\t\t// IMPORTANT: ^^^ add empty if there are no words to avoid \"needs repair\" issue triggered when cells have null content\n\t\t\t}\n\n\t\t\t// 5: increase table height by the curr line height (if we're on the last column)\n\t\t\tif (currCellIdx === rowCellLines.length - 1) emuTabCurrH += emuLineMaxH\n\n\t\t\t// 6: advance column/cell index (or circle back to first one to continue adding lines)\n\t\t\tcurrCellIdx = currCellIdx < rowCellLines.length - 1 ? currCellIdx + 1 : 0\n\n\t\t\t// 7: WIP: done?\n\t\t\tconst brent = rowCellLines.map((cell) => cell._lines.length).reduce((prev, next) => prev + next)\n\t\t\tif (brent === 0) isDone = true\n\t\t}\n\n\t\t// F: Flush/capture row buffer before it resets at the top of this loop\n\t\tif (currTableRow.length > 0) {\n\t\t\tnewTableRowSlide.rows.push(currTableRow)\n\t\t\tnewTableRowSlide.rowH?.push(resolveRowH(iRow))\n\t\t}\n\n\t\t// G: Update colSpanDepths for the next row's hasActiveRowSpan check.\n\t\t// Snapshot occupied columns *before* adding new spans from this row so that\n\t\t// cells in this row are placed correctly even when the row itself starts spans.\n\t\tconst occupiedBefore = [...colSpanDepths]\n\t\tlet colCursor = 0\n\t\trow.forEach((cell) => {\n\t\t\twhile (colCursor < numCols && (occupiedBefore[colCursor] ?? 0) > 0) colCursor++\n\t\t\tconst cellColspan = cell.options?.colspan ?? 1\n\t\t\tconst cellRowspan = cell.options?.rowspan ?? 1\n\t\t\tif (cellRowspan > 1) {\n\t\t\t\tfor (let c = 0; c < cellColspan && colCursor + c < numCols; c++) {\n\t\t\t\t\tcolSpanDepths[colCursor + c] = cellRowspan\n\t\t\t\t}\n\t\t\t}\n\t\t\tcolCursor += cellColspan\n\t\t})\n\t\t// Consume one row from every active span (including ones just opened above).\n\t\tfor (let c = 0; c < numCols; c++) {\n\t\t\tconst depth = colSpanDepths[c] ?? 0\n\t\t\tif (depth > 0) colSpanDepths[c] = depth - 1\n\t\t}\n\n\t\tif (tableProps.verbose) {\n\t\t\tconsole.log(\n\t\t\t\t`- SLIDE [${tableRowSlides.length}]: ROW [${iRow}]: ...COMPLETE ...... emuTabCurrH = ${(emuTabCurrH / EMU_PER_INCH).toFixed(2)} ( emuSlideTabH = ${(\n\t\t\t\t\temuSlideTabH / EMU_PER_INCH\n\t\t\t\t).toFixed(2)} )`\n\t\t\t)\n\t\t}\n\t})\n\n\t// STEP 7: Flush buffer / add final slide (skip an empty trailing buffer; always keep at least\n\t// one slide so a non-empty table is never reduced to zero pages)\n\tif (newTableRowSlide.rows.length > 0 || tableRowSlides.length === 0) tableRowSlides.push(newTableRowSlide)\n\n\tif (tableProps.verbose) {\n\t\tconsole.log('\\n|================================================|')\n\t\tconsole.log(`| FINAL: tableRowSlides.length = ${tableRowSlides.length}`)\n\t\ttableRowSlides.forEach((slide) => console.log(slide))\n\t\tconsole.log('|================================================|\\n\\n')\n\t}\n\n\t// LAST:\n\treturn tableRowSlides\n}\n"],"mappings":";;;;;;;;;;;AAyCA,SAAS,iBAAiB,MAAiB,UAAkB,SAAkC;CAK9F,MAAM,OAAO,OAAO,KAAK,SAAS,qBAAqB,KAAK,QAAQ,qBAAqB;CAOzF,MAAM,MACL,KAAK,MAAM,WAAA,EAA0B,MAAM,KAAK,SAAS,WAAW,KAAK,QAAQ,WAAA,MAA4B;CAK9G,IAAI,SACH,QAAQ,IACP,kBAAkB,SAAS,cAAc,KAAK,SAAS,YAAA,GAA0B,QAAQ,KAAK,OAAO,KACtG;CAED,MAAM,cAA6B,CAAC;CACpC,IAAI,aAA0B,CAAC;CAC/B,MAAM,cAA6B,CAAC;CACpC,MAAM,cAA6B,CAAC;;;;;;;;;;;;;;;CAmBpC,IAAI,KAAK,QAAQ,KAAK,KAAK,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,GAEvD,WAAW,KAAK;EAAE,OAAA;EAAkC,MAAM;CAAI,CAAC;MACzD,IAAI,OAAO,KAAK,SAAS,YAAY,OAAO,KAAK,SAAS,UAChE,WAAW,KAAK;EAAE,OAAA;EAAkC,OAAO,KAAK,QAAQ,GAAA,CAAI,SAAS,CAAC,CAAC,KAAK;CAAE,CAAC;MACzF,IAAI,MAAM,QAAQ,KAAK,IAAI,GACjC,aAAa,KAAK;CAEnB,IAAI,SAAS;EACZ,Q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AY,eAAe,OAAO,UAAU,KAAK,uCAAuC,cAAc,aAAA,CAAc,QAAQ,CAAC,EAAE,qBAC9H,eAAe,aAAA,CACd,QAAQ,CAAC,EAAE,GACd;CAEF,CAAC;CAID,IAAI,iBAAiB,KAAK,SAAS,KAAK,eAAe,WAAW,GAAG,eAAe,KAAK,gBAAgB;CAEzG,IAAI,WAAW,SAAS;EACvB,QAAQ,IAAI,sDAAsD;EAClE,QAAQ,IAAI,oCAAoC,eAAe,QAAQ;EACvE,eAAe,SAAS,UAAU,QAAQ,IAAI,KAAK,CAAC;EACpD,QAAQ,IAAI,wDAAwD;CACrE;CAGA,OAAO;AACR"}
@@ -0,0 +1,31 @@
1
+ import { C as isChartExType, S as connectorPresetFor, _ as TextAnchor, a as CONNECTOR_PRESETS, b as ZIP_OUTPUT_TYPE, c as OutputType, d as SCHEME_COLORS, f as SHAPE_NAME, g as TableStyle, h as SlideObjectType, i as CHART_NAME, l as PLACEHOLDER_TYPE, m as ShapeType, n as AlignV, o as CONNECTOR_PRESET_NAME, p as SchemeColor, r as BulletType, s as ChartType, t as AlignH, u as PlaceholderType, v as VALID_SHAPE_PRESETS, w as isChartType, x as asChartType, y as WRITE_OUTPUT_TYPE } from "./enums-CvRYniUA.js";
2
+ import { $ as BorderProps, $t as NotesProps, A as TableToSlidesDocument, At as ChartPropsChartHistogram, B as GradientStopProps, Bt as ChartPropsFillLine, C as TableCell, Cn as ShapeConnectionSite, Ct as ChartPropsAxisCat, D as TableProps, Dt as ChartPropsChartBar, E as TableCellProps, Et as ChartPropsBase, F as Coord, Ft as ChartPropsChartStock, G as Margin, Gt as OptsChartData, H as HexColor, Ht as ChartPropsTitle, I as DataOrPathProps, It as ChartPropsChartSurface, J as PositionProps, Jt as ObjectLockProps, K as PatternFillProps, Kt as OptsChartGridLine, L as DataOrPathRequiredProps, Lt as ChartPropsChartWaterfall, M as TableToSlidesProps, Mt as ChartPropsChartPie, N as BackgroundProps, Nt as ChartPropsChartRadar, O as TableRow, Ot as ChartPropsChartBoxWhisker, P as Color, Pt as ChartPropsChartRegionMap, Q as VAlign, Qt as MeasureTextOptions, R as GeometryPoint, Rt as ChartPropsDataLabel, S as TransitionType, Sn as ShapeAdjustValue, St as ChartOpts, T as TableCellDiagonals, Tn as ShapeProps, Tt as ChartPropsAxisVal, U as ImageFillProps, Ut as ChartSeriesOpts, V as HAlign, Vt as ChartPropsLegend, W as LinearGradientFillProps, Wt as LineCap, X as TextVertType, Xt as PlaceholderProps, Y as RadialGradientFillProps, Yt as ObjectNameProps, Z as ThemeColor, Zt as CommentProps, _ as AnimationProps, _n as MediaType, _t as ChartExBinning, a as Slide, an as TableLayoutResult, at as ShapeFillProps, b as TransitionProps, bn as ShapeAdjustHandlePolar, bt as ChartLineDash, c as Model3dPoint, cn as TextGlowProps, d as MasterTextStyleLevel, dn as TextPropsOptions, dt as PresetMaterialType, en as NotesTextOptions, et as ConnectorProps, f as MasterTextStyleProps, fn as textRun, g as SlideNumberProps, gn as MediaProps, gt as ChartErrorBarOptions, h as SlideMasterProps, hn as ImageProps, ht as ChartDataPointStyle, i as ObjectOptions, in as TableCellLayout, it as ShadowProps, j as TableToSlidesElement, jt as ChartPropsChartLine, k as TableRowSlide, kt as ChartPropsChartDoughnut, l as Model3dProps, ln as TextMeasurement, lt as LightRigDirection, m as SlideMasterObject, mn as ImageBaseProps, mt as ChartAxisTickMark, n as GroupChildProps, nn as ResolvedCommentAuthor, nt as HyperlinkActionJump, o as SlideLayout, on as TextBaseProps, ot as ShapeLineProps, p as SlideMasterChartProps, pn as textRuns, pt as ChartAreaProps, q as PatternPreset, qt as CommonObjectDescriptor, r as GroupProps, rn as SlideComment, rt as HyperlinkProps, s as Model3dCameraProps, sn as TextFitShrinkProps, st as BevelPresetType, t as AddSlideProps, tn as OverflowBoxOptions, tt as ConnectorType, u as MasterBulletProps, un as TextProps, ut as LightRigType, v as AnimationTrigger, vn as OleObjectProps, vt as ChartExGeography, w as TableCell3DProps, wn as ShapeGuide, wt as ChartPropsAxisSer, x as TransitionSoundProps, xn as ShapeAdjustHandleXY, xt as ChartMulti, y as PresetEffect, yn as ShapeAdjustHandle, yt as ChartExStatistics, z as GradientFillProps, zt as ChartPropsDataTable } from "./slide-js0QpRV-.js";
3
+ import { a as PresentationProps, c as WriteFileProps, d as ThemeProps, i as PresLayout, l as WriteProps, n as PackagePart, o as SectionProps, r as PartsProps, s as WriteBaseProps, t as CustomPropertyValue, u as ThemeColorScheme } from "./pres-C5__xkDh.js";
4
+ import { A as ptToHundredths, C as emuToInches, D as percentToEmu, E as inchesToEmu, M as SlideZoomProps, N as SummaryZoomProps, O as pixelsToEmu, P as ZoomBaseProps, S as coordToEmu, T as emuToPoints, _ as PERCENT_SCALE, a as ClipShape, b as StandardLayout, c as clipPath, d as DEFAULT_PX_PER_INCH, f as EMU_PER_INCH, g as HUNDREDTHS_PER_POINT, h as FIXED_PCT_PER_PERCENT, i as setDiagnosticHandler, j as SectionZoomProps, k as pointsToEmu, l as PresentationCore, m as Emu, n as DiagnosticHandler, o as FlatSide, p as EMU_PER_POINT, r as resetDiagnosticState, s as HalfDiscPreset, t as Diagnostic, u as ANGLE_UNITS_PER_DEGREE, v as POINTS_PER_INCH, w as emuToPixels, x as StandardLayoutName, y as STANDARD_LAYOUTS } from "./diagnostics-Du_s75MT.js";
5
+ import { a as TsPptxError, c as DiagnosticCode, d as InvalidOptionErrorCode, f as MediaErrorCode, h as UnsupportedFeatureErrorCode, i as PackageReadError, l as ErrorCode, m as TsPptxCode, n as InvalidOptionError, o as TsPptxErrorOptions, p as PackageReadErrorCode, r as MediaError, s as UnsupportedFeatureError, t as InternalError, u as InternalErrorCode } from "./errors-PflMPWBn.js";
6
+ //#region src/browser.d.ts
7
+ /**
8
+ * The browser entry, reached through the `browser` export condition — a bundler resolving the
9
+ * bare `@shbernal/ts-pptx` specifier for the web lands here without naming this subpath.
10
+ *
11
+ * Same authoring API as every other entry (see `entry-surface.ts`), plus one method that only
12
+ * makes sense with a live DOM: {@link TsPptx.tableToSlides}. `writeFile` triggers a download
13
+ * rather than touching a filesystem.
14
+ */
15
+ declare class TsPptx extends PresentationCore {
16
+ constructor();
17
+ /**
18
+ * Reproduces a rendered HTML `<table>` as a PowerPoint table — including column widths,
19
+ * style, etc. — creating one or more slides as needed. Resolves `eleId` against the global
20
+ * `document`, so it exists only on the browser/standalone build; the same conversion is
21
+ * available anywhere there is a DOM as the free `tableToSlides` on `ts-pptx/html`, which
22
+ * also takes the element directly. The in-memory `slide.addTable(rows, opts)` path remains
23
+ * the platform-agnostic way to build a table from data you already hold.
24
+ * @param {string} eleId - table HTML element ID
25
+ * @param {TableToSlidesProps} options - generation options
26
+ */
27
+ tableToSlides(eleId: string, options?: TableToSlidesProps): void;
28
+ }
29
+ //#endregion
30
+ export { ANGLE_UNITS_PER_DEGREE, AddSlideProps, AlignH, AlignV, AnimationProps, AnimationTrigger, BackgroundProps, type BevelPresetType, BorderProps, BulletType, CHART_NAME, CONNECTOR_PRESETS, CONNECTOR_PRESET_NAME, ChartAreaProps, ChartAxisTickMark, ChartDataPointStyle, ChartErrorBarOptions, ChartExBinning, ChartExGeography, ChartExStatistics, ChartLineDash, ChartMulti, ChartOpts, ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxisVal, ChartPropsBase, ChartPropsChartBar, ChartPropsChartBoxWhisker, ChartPropsChartDoughnut, ChartPropsChartHistogram, ChartPropsChartLine, ChartPropsChartPie, ChartPropsChartRadar, ChartPropsChartRegionMap, ChartPropsChartStock, ChartPropsChartSurface, ChartPropsChartWaterfall, ChartPropsDataLabel, ChartPropsDataTable, ChartPropsFillLine, ChartPropsLegend, ChartPropsTitle, ChartSeriesOpts, ChartType, ClipShape, Color, CommentProps, CommonObjectDescriptor, ConnectorProps, ConnectorType, Coord, CustomPropertyValue, DEFAULT_PX_PER_INCH, DataOrPathProps, DataOrPathRequiredProps, type Diagnostic, type DiagnosticCode, type DiagnosticHandler, EMU_PER_INCH, EMU_PER_POINT, Emu, type ErrorCode, FIXED_PCT_PER_PERCENT, FlatSide, GeometryPoint, GradientFillProps, GradientStopProps, GroupChildProps, GroupProps, HAlign, HUNDREDTHS_PER_POINT, HalfDiscPreset, HexColor, HyperlinkActionJump, HyperlinkProps, ImageBaseProps, ImageFillProps, ImageProps, InternalError, type InternalErrorCode, InvalidOptionError, type InvalidOptionErrorCode, type LightRigDirection, type LightRigType, LineCap, LinearGradientFillProps, Margin, MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps, MeasureTextOptions, MediaError, type MediaErrorCode, MediaProps, MediaType, Model3dCameraProps, Model3dPoint, Model3dProps, NotesProps, NotesTextOptions, ObjectLockProps, ObjectNameProps, ObjectOptions, OleObjectProps, OptsChartData, OptsChartGridLine, OutputType, OverflowBoxOptions, PERCENT_SCALE, PLACEHOLDER_TYPE, POINTS_PER_INCH, PackagePart, PackageReadError, type PackageReadErrorCode, PartsProps, PatternFillProps, PatternPreset, PlaceholderProps, PlaceholderType, PositionProps, PresLayout, PresentationProps, PresetEffect, type PresetMaterialType, RadialGradientFillProps, ResolvedCommentAuthor, SCHEME_COLORS, SHAPE_NAME, STANDARD_LAYOUTS, SchemeColor, SectionProps, SectionZoomProps, ShadowProps, ShapeAdjustHandle, ShapeAdjustHandlePolar, ShapeAdjustHandleXY, ShapeAdjustValue, ShapeConnectionSite, ShapeFillProps, ShapeGuide, ShapeLineProps, ShapeProps, ShapeType, Slide, SlideComment, SlideLayout, SlideMasterChartProps, SlideMasterObject, SlideMasterProps, SlideNumberProps, SlideObjectType, SlideZoomProps, StandardLayout, StandardLayoutName, SummaryZoomProps, TableCell, TableCell3DProps, TableCellDiagonals, TableCellLayout, TableCellProps, TableLayoutResult, TableProps, TableRow, TableRowSlide, TableStyle, TableToSlidesDocument, TableToSlidesElement, TableToSlidesProps, TextAnchor, TextBaseProps, TextFitShrinkProps, TextGlowProps, TextMeasurement, TextProps, TextPropsOptions, TextVertType, ThemeColor, ThemeColorScheme, ThemeProps, TransitionProps, TransitionSoundProps, TransitionType, TsPptx, TsPptx as default, type TsPptxCode, TsPptxError, type TsPptxErrorOptions, UnsupportedFeatureError, type UnsupportedFeatureErrorCode, VALID_SHAPE_PRESETS, VAlign, WRITE_OUTPUT_TYPE, WriteBaseProps, WriteFileProps, WriteProps, ZIP_OUTPUT_TYPE, ZoomBaseProps, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, isChartType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, resetDiagnosticState, setDiagnosticHandler, textRun, textRuns };
31
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","names":[],"sources":["../src/browser.ts"],"mappings":";;;;;;;;;;;;;;cAaa,eAAe;EAC3B;;;;;;;;;;;EAcA,cAAc,eAAe,UAAS"}