@shbernal/ts-pptx 1.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +10 -3
  2. package/dist/{autopage-tmfjRzL4.js → autopage-MxulehqQ.js} +3 -4
  3. package/dist/{autopage-tmfjRzL4.js.map → autopage-MxulehqQ.js.map} +1 -1
  4. package/dist/browser.d.ts +14 -6
  5. package/dist/browser.d.ts.map +1 -1
  6. package/dist/browser.js +12 -4
  7. package/dist/browser.js.map +1 -1
  8. package/dist/{diagnostics-DzY9Tyfm.d.ts → diagnostics-BqBTmA3a.d.ts} +95 -23
  9. package/dist/diagnostics-BqBTmA3a.d.ts.map +1 -0
  10. package/dist/{enums-D3aF4QGb.d.ts → enums-oLLeaSW3.d.ts} +2 -1
  11. package/dist/{enums-D3aF4QGb.d.ts.map → enums-oLLeaSW3.d.ts.map} +1 -1
  12. package/dist/{errors-DRLpOpgQ.d.ts → errors-BENA-Xuw.d.ts} +3 -3
  13. package/dist/{errors-DRLpOpgQ.d.ts.map → errors-BENA-Xuw.d.ts.map} +1 -1
  14. package/dist/errors-DGE9zh3U.js.map +1 -1
  15. package/dist/{fit-CbxyHN69.js → fit-DGSwMMNs.js} +0 -0
  16. package/dist/{fit-CbxyHN69.js.map → fit-DGSwMMNs.js.map} +1 -1
  17. package/dist/{html-dom-wVa3TiG7.js → html-dom--J-Xuucf.js} +19 -5
  18. package/dist/html-dom--J-Xuucf.js.map +1 -0
  19. package/dist/html.d.ts +3 -3
  20. package/dist/html.d.ts.map +1 -1
  21. package/dist/html.js +6 -3
  22. package/dist/html.js.map +1 -1
  23. package/dist/index.d.ts +6 -6
  24. package/dist/index.js +4 -4
  25. package/dist/index.js.map +1 -1
  26. package/dist/inspect.d.ts +1 -1
  27. package/dist/inspect.js +2 -2
  28. package/dist/inspect.js.map +1 -1
  29. package/dist/math.d.ts +1 -1
  30. package/dist/math.js +2 -1
  31. package/dist/math.js.map +1 -1
  32. package/dist/measure.d.ts +2 -2
  33. package/dist/measure.js +1 -1
  34. package/dist/node.d.ts +14 -6
  35. package/dist/node.d.ts.map +1 -1
  36. package/dist/node.js +11 -3
  37. package/dist/node.js.map +1 -1
  38. package/dist/{pres-5x1bjCzk.d.ts → pres-2WsBGimU.d.ts} +3 -3
  39. package/dist/{pres-5x1bjCzk.d.ts.map → pres-2WsBGimU.d.ts.map} +1 -1
  40. package/dist/{presentation-RGOiun5P.d.ts → presentation-CTVPpiwP.d.ts} +912 -485
  41. package/dist/presentation-CTVPpiwP.d.ts.map +1 -0
  42. package/dist/{presentation-B0JWdTN1.js → presentation-DAcOfzsP.js} +880 -366
  43. package/dist/presentation-DAcOfzsP.js.map +1 -0
  44. package/dist/read.d.ts +4 -4
  45. package/dist/read.d.ts.map +1 -1
  46. package/dist/read.js +2 -2
  47. package/dist/script.d.ts +2 -2
  48. package/dist/script.d.ts.map +1 -1
  49. package/dist/script.js +0 -0
  50. package/dist/script.js.map +1 -1
  51. package/dist/{shapes-BZU8UTW2.js → shapes-BWifcHDV.js} +1520 -996
  52. package/dist/shapes-BWifcHDV.js.map +1 -0
  53. package/dist/{slide-B6mDaM-P.d.ts → slide-YuSCGa45.d.ts} +409 -103
  54. package/dist/slide-YuSCGa45.d.ts.map +1 -0
  55. package/dist/{image-size-C5Z1sKof.js → st-enums-CgadEyPM.js} +235 -4
  56. package/dist/st-enums-CgadEyPM.js.map +1 -0
  57. package/dist/{text-WRUbOy2r.js → text-120VFSDm.js} +1027 -369
  58. package/dist/text-120VFSDm.js.map +1 -0
  59. package/dist/{units-internal-7JcMfYti.js → units-internal-CiFWZWk4.js} +2 -1
  60. package/dist/units-internal-CiFWZWk4.js.map +1 -0
  61. package/dist/zip.d.ts +2 -2
  62. package/dist/zip.js.map +1 -1
  63. package/package.json +38 -36
  64. package/dist/diagnostics-DzY9Tyfm.d.ts.map +0 -1
  65. package/dist/html-dom-wVa3TiG7.js.map +0 -1
  66. package/dist/image-size-C5Z1sKof.js.map +0 -1
  67. package/dist/presentation-B0JWdTN1.js.map +0 -1
  68. package/dist/presentation-RGOiun5P.d.ts.map +0 -1
  69. package/dist/shapes-BZU8UTW2.js.map +0 -1
  70. package/dist/slide-B6mDaM-P.d.ts.map +0 -1
  71. package/dist/text-WRUbOy2r.js.map +0 -1
  72. package/dist/units-internal-7JcMfYti.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # ts-pptx
2
2
 
3
- [![npm](https://img.shields.io/npm/v/@shbernal/ts-pptx)](https://www.npmjs.com/package/@shbernal/ts-pptx)
3
+ [![npm](https://img.shields.io/npm/v/%40shbernal%2Fts-pptx)](https://www.npmjs.com/package/@shbernal/ts-pptx)
4
+ [![weekly downloads](https://img.shields.io/npm/dw/%40shbernal%2Fts-pptx.svg?label=npm%20downloads&logo=npm)](https://www.npmjs.com/package/@shbernal/ts-pptx)
5
+ [![total downloads](https://img.shields.io/npm/dt/%40shbernal%2Fts-pptx.svg?label=npm%20total%20downloads&logo=npm)](https://www.npmjs.com/package/@shbernal/ts-pptx)
4
6
  [![CI](https://github.com/shbernal/ts-pptx/actions/workflows/ci.yml/badge.svg)](https://github.com/shbernal/ts-pptx/actions/workflows/ci.yml)
5
7
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
8
 
@@ -163,10 +165,15 @@ delegates to the same implementation.
163
165
  **Column widths need a layout engine.** In a browser the columns are sized from
164
166
  each cell's rendered `offsetWidth`, reproducing the table's real proportions.
165
167
  Nothing outside a browser lays a table out, so `offsetWidth` is `0` there and
166
- the conversion degrades in two steps: it uses the computed CSS `width`s when the
168
+ the conversion falls back in two steps: it uses the computed CSS `width`s when the
167
169
  stylesheet states them for every column in one unit (all `px` or all `%`), and
168
170
  an equal split when it does not.
169
171
 
172
+ The first step is a *fallback*, not a graceful loss of precision: `offsetWidth` is
173
+ the border box and computed `width` the content box, so padding alone can put the
174
+ two bases in different proportions. The same table can therefore come out with
175
+ different column widths in a browser and outside one.
176
+
170
177
  To pin widths regardless of runtime, annotate the `<thead>` header cells — these
171
178
  win outright on every path:
172
179
 
@@ -195,7 +202,7 @@ The full documentation site is published at
195
202
  - [Testing guide](docs/testing.md)
196
203
  - [Agent development guide](docs/agent-development.md)
197
204
  - [OOXML agent context](docs/ooxml-agent-context.md)
198
- - [Backlog workflow](docs/backlog-workflow.md)
205
+ - [Evidence and fixtures](docs/evidence-and-fixtures.md)
199
206
 
200
207
  ## Repository Development
201
208
 
@@ -1,6 +1,6 @@
1
1
  import { n as warn } from "./diagnostics-DYQC7xLV.js";
2
2
  import { i as EMU_PER_POINT, r as EMU_PER_INCH } from "./units-B-JUKwCS.js";
3
- import { E as DEF_SLIDE_MARGIN_IN, P as LINEH_MODIFIER, i as inch2Emu, o as marginToEmu, r as getSmartParseNumber } from "./units-internal-7JcMfYti.js";
3
+ import { E as DEF_SLIDE_MARGIN_IN, P as LINEH_MODIFIER, i as inch2Emu, o as marginToEmu, r as getSmartParseNumber } from "./units-internal-CiFWZWk4.js";
4
4
  //#region src/gen/table/autopage.ts
5
5
  /**
6
6
  * Break cell text into lines based upon table column width (e.g.: Magic Happens Here(tm))
@@ -358,9 +358,8 @@ function getSlidesForTableRows(tableRows = [], tableProps = {}, presLayout, mast
358
358
  options: cell.options
359
359
  }));
360
360
  calcSlideTabH();
361
- emuTabCurrH += maxCellMarTopEmu + maxCellMarBtmEmu;
361
+ emuTabCurrH = maxCellMarTopEmu + maxCellMarBtmEmu;
362
362
  if (tableProps.verbose) console.log(`| SLIDE [${tableRowSlides.length}]: emuSlideTabH ...... = ${(emuSlideTabH / EMU_PER_INCH).toFixed(1)} `);
363
- emuTabCurrH = 0;
364
363
  if (tableProps.autoPageRepeatHeader && tableProps._arrObjTabHeadRows) tableProps._arrObjTabHeadRows.forEach((row, headIdx) => {
365
364
  const newHeadRow = [];
366
365
  let maxLineHeight = 0;
@@ -417,4 +416,4 @@ function getSlidesForTableRows(tableRows = [], tableProps = {}, presLayout, mast
417
416
  //#endregion
418
417
  export { getSlidesForTableRows as t };
419
418
 
420
- //# sourceMappingURL=autopage-tmfjRzL4.js.map
419
+ //# sourceMappingURL=autopage-MxulehqQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autopage-tmfjRzL4.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, EMU_PER_POINT } 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 * @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\tconst CPL =\n\t\tMath.floor((colWidth / EMU_PER_POINT) * EMU_PER_INCH) /\n\t\t((cell.options?.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / FOCO) // Chars-Per-Line\n\n\tconst parsedLines: TableCell[][] = []\n\tlet inputCells: TableCell[] = []\n\tconst inputLines1: TableCell[][] = []\n\tconst inputLines2: TableCell[][] = []\n\t/*\n\t\tif (cell.options && cell.options.autoPageCharWeight) {\n\t\t\tlet CHR1 = 2.3 + (cell.options && cell.options.autoPageCharWeight ? cell.options.autoPageCharWeight : 0) // Character Constant\n\t\t\tlet CPL1 = ((colWidth / EMU_PER_POINT) * EMU_PER_INCH) / ((cell.options && cell.options.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / CHR1) // Chars-Per-Line\n\t\t\tconsole.log(`cell.options.autoPageCharWeight: '${cell.options.autoPageCharWeight}' => CPL: ${CPL1}`)\n\t\t\tlet CHR2 = 2.3 + 0\n\t\t\tlet CPL2 = ((colWidth / EMU_PER_POINT) * EMU_PER_INCH) / ((cell.options && cell.options.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / CHR2) // Chars-Per-Line\n\t\t\tconsole.log(`cell.options.autoPageCharWeight: '0' => CPL: ${CPL2}`)\n\t\t}\n\t*/\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, false)\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\t\t\t\temuTabCurrH += maxCellMarTopEmu + maxCellMarBtmEmu // Start row height with margins\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// F: reset current table height for this new Slide\n\t\t\t\temuTabCurrH = 0\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":";;;;;;;;;;AAuCA,SAAS,iBAAiB,MAAiB,UAAkB,SAAkC;CAK9F,MAAM,OAAO,OAAO,KAAK,SAAS,qBAAqB,KAAK,QAAQ,qBAAqB;CACzF,MAAM,MACL,KAAK,MAAO,WAAW,gBAAiB,YAAY,MAClD,KAAK,SAAS,WAAW,KAAK,QAAQ,WAAA,MAA4B;CAErE,MAAM,cAA6B,CAAC;CACpC,IAAI,aAA0B,CAAC;CAC/B,MAAM,cAA6B,CAAC;CACpC,MAAM,cAA6B,CAAC;;;;;;;;;;;;;;;CA6BpC,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,QAAQ,IAAI,kBAAkB;EAC9B,WAAW,SAAS,MAAM,QAAQ,QAAQ,IAAI,UAAU,MAAM,EAAE,UAAU,KAAK,UAAU,IAAI,GAAG,CAAC;CAClG;;;;;;;CASA,IAAI,UAAuB,CAAC;CAC5B,WAAW,SAAS,SAAS;EAC5B,IAAI,OAAO,KAAK,SAAS,UAAU;EAEnC,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG;GAG7B,MAAM,QAAQ,KAAK,KAAK,MAAM,IAAI;GA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AAK,CAAC;EACpD,QAAQ,IAAI,wDAAwD;CACrE;CAGA,OAAO;AACR"}
1
+ {"version":3,"file":"autopage-MxulehqQ.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, EMU_PER_POINT } 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 * @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\tconst CPL =\n\t\tMath.floor((colWidth / EMU_PER_POINT) * EMU_PER_INCH) /\n\t\t((cell.options?.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / FOCO) // Chars-Per-Line\n\n\tconst parsedLines: TableCell[][] = []\n\tlet inputCells: TableCell[] = []\n\tconst inputLines1: TableCell[][] = []\n\tconst inputLines2: TableCell[][] = []\n\t/*\n\t\tif (cell.options && cell.options.autoPageCharWeight) {\n\t\t\tlet CHR1 = 2.3 + (cell.options && cell.options.autoPageCharWeight ? cell.options.autoPageCharWeight : 0) // Character Constant\n\t\t\tlet CPL1 = ((colWidth / EMU_PER_POINT) * EMU_PER_INCH) / ((cell.options && cell.options.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / CHR1) // Chars-Per-Line\n\t\t\tconsole.log(`cell.options.autoPageCharWeight: '${cell.options.autoPageCharWeight}' => CPL: ${CPL1}`)\n\t\t\tlet CHR2 = 2.3 + 0\n\t\t\tlet CPL2 = ((colWidth / EMU_PER_POINT) * EMU_PER_INCH) / ((cell.options && cell.options.fontSize ? cell.options.fontSize : DEF_FONT_SIZE) / CHR2) // Chars-Per-Line\n\t\t\tconsole.log(`cell.options.autoPageCharWeight: '0' => CPL: ${CPL2}`)\n\t\t}\n\t*/\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, false)\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":";;;;;;;;;;AAuCA,SAAS,iBAAiB,MAAiB,UAAkB,SAAkC;CAK9F,MAAM,OAAO,OAAO,KAAK,SAAS,qBAAqB,KAAK,QAAQ,qBAAqB;CACzF,MAAM,MACL,KAAK,MAAO,WAAW,gBAAiB,YAAY,MAClD,KAAK,SAAS,WAAW,KAAK,QAAQ,WAAA,MAA4B;CAErE,MAAM,cAA6B,CAAC;CACpC,IAAI,aAA0B,CAAC;CAC/B,MAAM,cAA6B,CAAC;CACpC,MAAM,cAA6B,CAAC;;;;;;;;;;;;;;;CA6BpC,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,SA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uC,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"}
package/dist/browser.d.ts CHANGED
@@ -1,9 +1,17 @@
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, x as asChartType, y as WRITE_OUTPUT_TYPE } from "./enums-D3aF4QGb.js";
2
- import { $ as LinearGradientFillProps, $t as CommentProps, A as ImageBaseProps, At as ChartPropsChartBar, B as ShapeGuide, Bt as ChartPropsChartWaterfall, C as TableRow, Ct as ChartLineDash, D as TableToSlidesDocument, Dt as ChartPropsAxisSer, E as TableStyleRegionProps, Et as ChartPropsAxisCat, F as ShapeAdjustHandle, Ft as ChartPropsChartPie, G as DataOrPathProps, Gt as ChartPropsTitle, H as BackgroundProps, Ht as ChartPropsDataTable, I as ShapeAdjustHandlePolar, It as ChartPropsChartRadar, J as GradientFillProps, Jt as OptsChartData, K as DataOrPathRequiredProps, Kt as ChartSeriesOpts, L as ShapeAdjustHandleXY, Lt as ChartPropsChartRegionMap, M as MediaProps, Mt as ChartPropsChartDoughnut, N as MediaType, Nt as ChartPropsChartHistogram, O as TableToSlidesElement, Ot as ChartPropsAxisVal, P as OleObjectProps, Pt as ChartPropsChartLine, Q as ImageFillProps, Qt as PlaceholderProps, R as ShapeAdjustValue, Rt as ChartPropsChartStock, S as TableProps, St as ChartExStatistics, T as TableStyleProps, Tt as ChartOpts, U as Color, Ut as ChartPropsFillLine, V as ShapeProps, Vt as ChartPropsDataLabel, W as Coord, Wt as ChartPropsLegend, X as HAlign, Xt as ObjectLockProps, Y as GradientStopProps, Yt as OptsChartGridLine, Z as HexColor, Zt as ObjectNameProps, _ as TransitionProps, _t as ChartAxisTickMark, a as Slide, an as SlideComment, at as TextVertType, b as TableCell, bt as ChartExBinning, c as MasterTextStyleLevel, cn as TextBaseProps, ct as BorderProps, d as SlideMasterObject, dn as TextMeasurement, dt as HyperlinkActionJump, en as MeasureTextOptions, et as Margin, f as SlideMasterProps, fn as TextProps, ft as HyperlinkProps, g as PresetEffect, gt as ChartAreaProps, h as AnimationTrigger, hn as textRuns, ht as ShapeLineProps, i as ObjectOptions, in as ResolvedCommentAuthor, it as RadialGradientFillProps, j as ImageProps, jt as ChartPropsChartBoxWhisker, k as TableToSlidesProps, kt as ChartPropsBase, l as MasterTextStyleProps, ln as TextFitShrinkProps, lt as ConnectorProps, m as AnimationProps, mn as textRun, mt as ShapeFillProps, n as GroupChildProps, nn as NotesTextOptions, nt as PatternPreset, o as SlideLayout, on as TableCellLayout, ot as ThemeColor, p as SlideNumberProps, pn as TextPropsOptions, pt as ShadowProps, q as GeometryPoint, qt as LineCap, r as GroupProps, rn as OverflowBoxOptions, rt as PositionProps, s as MasterBulletProps, sn as TableLayoutResult, st as VAlign, t as AddSlideProps, tn as NotesProps, tt as PatternFillProps, u as SlideMasterChartProps, un as TextGlowProps, ut as ConnectorType, v as TransitionSoundProps, vt as ChartDataPointStyle, w as TableRowSlide, wt as ChartMulti, x as TableCellProps, xt as ChartExGeography, y as TransitionType, yt as ChartErrorBarOptions, z as ShapeConnectionSite, zt as ChartPropsChartSurface } from "./slide-B6mDaM-P.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-5x1bjCzk.js";
4
- import { C as pixelsToEmu, D as SlideZoomProps, E as SectionZoomProps, O as SummaryZoomProps, S as percentToEmu, T as ptToHundredths, _ as coordToEmu, a as ANGLE_UNITS_PER_DEGREE, b as emuToPoints, c as EMU_PER_POINT, d as HUNDREDTHS_PER_POINT, f as PERCENT_SCALE, g as StandardLayoutName, h as StandardLayout, i as PresentationCore, k as ZoomBaseProps, l as Emu, m as STANDARD_LAYOUTS, n as DiagnosticHandler, o as DEFAULT_PX_PER_INCH, p as POINTS_PER_INCH, r as setDiagnosticHandler, s as EMU_PER_INCH, t as Diagnostic, u as FIXED_PCT_PER_PERCENT, v as emuToInches, w as pointsToEmu, x as inchesToEmu, y as emuToPixels } from "./diagnostics-DzY9Tyfm.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-DRLpOpgQ.js";
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, x as asChartType, y as WRITE_OUTPUT_TYPE } from "./enums-oLLeaSW3.js";
2
+ import { $ as HAlign, $t as ChartSeriesOpts, A as TableToSlidesDocument, At as ChartLineDash, B as ShapeAdjustHandleXY, Bt as ChartPropsChartHistogram, C as TableCell, Ct as ChartAreaProps, D as TableProps, Dt as ChartExBinning, E as TableCellProps, Et as ChartErrorBarOptions, F as MediaProps, Ft as ChartPropsAxisVal, G as BackgroundProps, Gt as ChartPropsChartStock, H as ShapeConnectionSite, Ht as ChartPropsChartPie, I as MediaType, It as ChartPropsBase, J as DataOrPathProps, Jt as ChartPropsDataLabel, K as Color, Kt as ChartPropsChartSurface, L as OleObjectProps, Lt as ChartPropsChartBar, M as TableToSlidesProps, Mt as ChartOpts, N as ImageBaseProps, Nt as ChartPropsAxisCat, O as TableRow, Ot as ChartExGeography, P as ImageProps, Pt as ChartPropsAxisSer, Q as GradientStopProps, Qt as ChartPropsTitle, R as ShapeAdjustHandle, Rt as ChartPropsChartBoxWhisker, S as TransitionType, Sn as textRuns, St as PresetMaterialType, T as TableCellDiagonals, Tt as ChartDataPointStyle, U as ShapeGuide, Ut as ChartPropsChartRadar, V as ShapeAdjustValue, Vt as ChartPropsChartLine, W as ShapeProps, Wt as ChartPropsChartRegionMap, X as GeometryPoint, Xt as ChartPropsFillLine, Y as DataOrPathRequiredProps, Yt as ChartPropsDataTable, Z as GradientFillProps, Zt as ChartPropsLegend, _ as AnimationProps, _n as TextGlowProps, _t as ShapeFillProps, a as Slide, an as PlaceholderProps, at as PatternPreset, b as TransitionProps, bn as TextPropsOptions, bt as LightRigDirection, c as Model3dPoint, cn as NotesProps, ct as TextVertType, d as MasterTextStyleLevel, dn as ResolvedCommentAuthor, dt as BorderProps, en as LineCap, et as HexColor, f as MasterTextStyleProps, fn as SlideComment, ft as ConnectorProps, g as SlideNumberProps, gn as TextFitShrinkProps, gt as ShadowProps, h as SlideMasterProps, hn as TextBaseProps, ht as HyperlinkProps, i as ObjectOptions, in as ObjectNameProps, it as PatternFillProps, j as TableToSlidesElement, jt as ChartMulti, k as TableRowSlide, kt as ChartExStatistics, l as Model3dProps, ln as NotesTextOptions, lt as ThemeColor, m as SlideMasterObject, mn as TableLayoutResult, mt as HyperlinkActionJump, n as GroupChildProps, nn as OptsChartGridLine, nt as LinearGradientFillProps, o as SlideLayout, on as CommentProps, ot as PositionProps, p as SlideMasterChartProps, pn as TableCellLayout, pt as ConnectorType, q as Coord, qt as ChartPropsChartWaterfall, r as GroupProps, rn as ObjectLockProps, rt as Margin, s as Model3dCameraProps, sn as MeasureTextOptions, st as RadialGradientFillProps, t as AddSlideProps, tn as OptsChartData, tt as ImageFillProps, u as MasterBulletProps, un as OverflowBoxOptions, ut as VAlign, v as AnimationTrigger, vn as TextMeasurement, vt as ShapeLineProps, w as TableCell3DProps, wt as ChartAxisTickMark, x as TransitionSoundProps, xn as textRun, xt as LightRigType, y as PresetEffect, yn as TextProps, yt as BevelPresetType, z as ShapeAdjustHandlePolar, zt as ChartPropsChartDoughnut } from "./slide-YuSCGa45.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-2WsBGimU.js";
4
+ import { A as SectionZoomProps, C as emuToPixels, D as pixelsToEmu, E as percentToEmu, M as SummaryZoomProps, N as ZoomBaseProps, O as pointsToEmu, S as emuToInches, T as inchesToEmu, _ as POINTS_PER_INCH, a as FlatSide, b as StandardLayoutName, c as PresentationCore, d as EMU_PER_INCH, f as EMU_PER_POINT, g as PERCENT_SCALE, h as HUNDREDTHS_PER_POINT, i as ClipShape, j as SlideZoomProps, k as ptToHundredths, l as ANGLE_UNITS_PER_DEGREE, m as FIXED_PCT_PER_PERCENT, n as DiagnosticHandler, o as HalfDiscPreset, p as Emu, r as setDiagnosticHandler, s as clipPath, t as Diagnostic, u as DEFAULT_PX_PER_INCH, v as STANDARD_LAYOUTS, w as emuToPoints, x as coordToEmu, y as StandardLayout } from "./diagnostics-BqBTmA3a.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-BENA-Xuw.js";
6
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
+ */
7
15
  declare class TsPptx extends PresentationCore {
8
16
  constructor();
9
17
  /**
@@ -19,5 +27,5 @@ declare class TsPptx extends PresentationCore {
19
27
  tableToSlides(eleId: string, options?: TableToSlidesProps): void;
20
28
  }
21
29
  //#endregion
22
- export { ANGLE_UNITS_PER_DEGREE, AddSlideProps, AlignH, AlignV, AnimationProps, AnimationTrigger, BackgroundProps, 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, Color, CommentProps, 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, GeometryPoint, GradientFillProps, GradientStopProps, GroupChildProps, GroupProps, HAlign, HUNDREDTHS_PER_POINT, HexColor, HyperlinkActionJump, HyperlinkProps, ImageBaseProps, ImageFillProps, ImageProps, InternalError, type InternalErrorCode, InvalidOptionError, type InvalidOptionErrorCode, LineCap, LinearGradientFillProps, Margin, MasterBulletProps, MasterTextStyleLevel, MasterTextStyleProps, MeasureTextOptions, MediaError, type MediaErrorCode, MediaProps, MediaType, 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, 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, TableCellLayout, TableCellProps, TableLayoutResult, TableProps, TableRow, TableRowSlide, TableStyle, TableStyleProps, TableStyleRegionProps, 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, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, setDiagnosticHandler, textRun, textRuns };
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, 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, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, setDiagnosticHandler, textRun, textRuns };
23
31
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","names":[],"sources":["../src/browser.ts"],"mappings":";;;;;;cAKa,eAAe;;;;;;;;;;;;EAe3B,cAAc,eAAe,UAAS"}
1
+ {"version":3,"file":"browser.d.ts","names":[],"sources":["../src/browser.ts"],"mappings":";;;;;;;;;;;;;;cAaa,eAAe;;;;;;;;;;;;EAe3B,cAAc,eAAe,UAAS"}
package/dist/browser.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { t as setDiagnosticHandler } from "./diagnostics-DYQC7xLV.js";
2
2
  import { a as TsPptxError, i as PackageReadError, n as InvalidOptionError, o as UnsupportedFeatureError, r as MediaError, t as InternalError } from "./errors-DGE9zh3U.js";
3
3
  import { _ as pointsToEmu, a as FIXED_PCT_PER_PERCENT, c as POINTS_PER_INCH, d as emuToInches, f as emuToPixels, g as pixelsToEmu, h as percentToEmu, i as EMU_PER_POINT, l as STANDARD_LAYOUTS, m as inchesToEmu, n as DEFAULT_PX_PER_INCH, o as HUNDREDTHS_PER_POINT, p as emuToPoints, r as EMU_PER_INCH, s as PERCENT_SCALE, t as ANGLE_UNITS_PER_DEGREE, u as coordToEmu, v as ptToHundredths } from "./units-B-JUKwCS.js";
4
- import { n as textRuns, r as PresentationCore, t as textRun } from "./text-WRUbOy2r.js";
5
- import { $ as connectorPresetFor, B as AlignV, G as PlaceholderType, H as CONNECTOR_PRESETS, J as SlideObjectType, K as SchemeColor, Q as asChartType, U as ChartType, V as BulletType, W as OutputType, X as TextAnchor, Y as TableStyle, Z as VALID_SHAPE_PRESETS, et as isChartExType, j as IMG_SVG_PLACEHOLDER, q as ShapeType, z as AlignH } from "./units-internal-7JcMfYti.js";
6
- import { t as genTableToSlides } from "./html-dom-wVa3TiG7.js";
4
+ import { i as PresentationCore, n as textRuns, r as clipPath, t as textRun } from "./text-120VFSDm.js";
5
+ import { $ as connectorPresetFor, B as AlignV, G as PlaceholderType, H as CONNECTOR_PRESETS, J as SlideObjectType, K as SchemeColor, Q as asChartType, U as ChartType, V as BulletType, W as OutputType, X as TextAnchor, Y as TableStyle, Z as VALID_SHAPE_PRESETS, et as isChartExType, j as IMG_SVG_PLACEHOLDER, q as ShapeType, z as AlignH } from "./units-internal-CiFWZWk4.js";
6
+ import { t as genTableToSlides } from "./html-dom--J-Xuucf.js";
7
7
  //#region src/runtime/browser.ts
8
8
  function createBrowserRuntime() {
9
9
  return {
@@ -79,6 +79,14 @@ async function writeFile(fileName, data) {
79
79
  }
80
80
  //#endregion
81
81
  //#region src/browser.ts
82
+ /**
83
+ * The browser entry, reached through the `browser` export condition — a bundler resolving the
84
+ * bare `@shbernal/ts-pptx` specifier for the web lands here without naming this subpath.
85
+ *
86
+ * Same authoring API as every other entry (see `entry-surface.ts`), plus one method that only
87
+ * makes sense with a live DOM: {@link TsPptx.tableToSlides}. `writeFile` triggers a download
88
+ * rather than touching a filesystem.
89
+ */
82
90
  var TsPptx = class extends PresentationCore {
83
91
  constructor() {
84
92
  super(createBrowserRuntime());
@@ -98,6 +106,6 @@ var TsPptx = class extends PresentationCore {
98
106
  }
99
107
  };
100
108
  //#endregion
101
- export { ANGLE_UNITS_PER_DEGREE, AlignH, AlignV, BulletType, CONNECTOR_PRESETS, ChartType, DEFAULT_PX_PER_INCH, EMU_PER_INCH, EMU_PER_POINT, FIXED_PCT_PER_PERCENT, HUNDREDTHS_PER_POINT, InternalError, InvalidOptionError, MediaError, OutputType, PERCENT_SCALE, POINTS_PER_INCH, PackageReadError, PlaceholderType, STANDARD_LAYOUTS, SchemeColor, ShapeType, SlideObjectType, TableStyle, TextAnchor, TsPptx, TsPptx as default, TsPptxError, UnsupportedFeatureError, VALID_SHAPE_PRESETS, asChartType, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, setDiagnosticHandler, textRun, textRuns };
109
+ export { ANGLE_UNITS_PER_DEGREE, AlignH, AlignV, BulletType, CONNECTOR_PRESETS, ChartType, DEFAULT_PX_PER_INCH, EMU_PER_INCH, EMU_PER_POINT, FIXED_PCT_PER_PERCENT, HUNDREDTHS_PER_POINT, InternalError, InvalidOptionError, MediaError, OutputType, PERCENT_SCALE, POINTS_PER_INCH, PackageReadError, PlaceholderType, STANDARD_LAYOUTS, SchemeColor, ShapeType, SlideObjectType, TableStyle, TextAnchor, TsPptx, TsPptx as default, TsPptxError, UnsupportedFeatureError, VALID_SHAPE_PRESETS, asChartType, clipPath, connectorPresetFor, coordToEmu, emuToInches, emuToPixels, emuToPoints, inchesToEmu, isChartExType, percentToEmu, pixelsToEmu, pointsToEmu, ptToHundredths, setDiagnosticHandler, textRun, textRuns };
102
110
 
103
111
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","names":[],"sources":["../src/runtime/browser.ts","../src/browser.ts"],"sourcesContent":["import { IMG_SVG_PLACEHOLDER } from '../constants-internal.js'\nimport { MediaError } from '../errors.js'\nimport type { SlideRelMedia } from '../types/internal.js'\nimport type { RuntimeAdapter } from './types.js'\n\nexport function createBrowserRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: null,\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t\tloadFontData,\n\t}\n}\n\nasync function loadFontData(source: string): Promise<Uint8Array> {\n\tconst response = await fetch(source)\n\tif (!response.ok) throw new MediaError('font/fetch-failed', `Unable to load font (fetch): ${source}`)\n\treturn new Uint8Array(await response.arrayBuffer())\n}\n\nasync function loadMedia(rel: SlideRelMedia & { path: string }): Promise<string> {\n\tconst response = await fetch(rel.path)\n\tif (!response.ok) throw new MediaError('media/fetch-failed', `Unable to load image (fetch): ${rel.path}`)\n\tconst blob = await response.blob()\n\n\treturn await new Promise<string>((resolve, reject) => {\n\t\tconst reader = new FileReader()\n\t\treader.onloadend = () => resolve(reader.result as string)\n\t\treader.onerror = () =>\n\t\t\treject(new MediaError('media/decode-failed', `Unable to load image (FileReader): ${rel.path}`))\n\t\treader.readAsDataURL(blob)\n\t})\n}\n\nasync function createSvgPngPreview(rel: SlideRelMedia): Promise<string> {\n\treturn await new Promise((resolve, reject) => {\n\t\tconst image = new Image()\n\t\tconst fail = (reason?: unknown) => {\n\t\t\trel.data = IMG_SVG_PLACEHOLDER\n\t\t\treject(\n\t\t\t\tnew MediaError(\n\t\t\t\t\t'media/svg-preview-failed',\n\t\t\t\t\t`Unable to load image (image.onerror): ${rel.path}${reason ? ` - ${String(reason)}` : ''}`\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\timage.onload = () => {\n\t\t\tif (image.width + image.height === 0) {\n\t\t\t\tfail('h/w=0')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst canvas = document.createElement('CANVAS') as HTMLCanvasElement\n\t\t\tconst ctx = canvas.getContext('2d')\n\t\t\tif (!ctx) {\n\t\t\t\tfail('canvas 2d context unavailable')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcanvas.width = image.width\n\t\t\tcanvas.height = image.height\n\t\t\tctx.drawImage(image, 0, 0)\n\t\t\ttry {\n\t\t\t\trel.data = canvas.toDataURL(rel.type)\n\t\t\t\tresolve('done')\n\t\t\t} catch (ex) {\n\t\t\t\tfail(ex)\n\t\t\t}\n\t\t}\n\t\timage.onerror = () => fail()\n\t\timage.src = typeof rel.data === 'string' ? rel.data : IMG_SVG_PLACEHOLDER\n\t})\n}\n\nasync function writeFile(fileName: string, data: string | ArrayBuffer | Blob | Uint8Array): Promise<string> {\n\tconst eleLink = document.createElement('a')\n\teleLink.setAttribute('style', 'display:none;')\n\teleLink.dataset['interception'] = 'off'\n\tdocument.body.appendChild(eleLink)\n\n\tconst url = window.URL.createObjectURL(\n\t\tnew Blob([data as Blob], { type: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' })\n\t)\n\teleLink.href = url\n\teleLink.download = fileName\n\teleLink.click()\n\n\tsetTimeout(() => {\n\t\twindow.URL.revokeObjectURL(url)\n\t\tdocument.body.removeChild(eleLink)\n\t}, 100)\n\n\treturn fileName\n}\n","import PresentationCore from './presentation.js'\nimport { createBrowserRuntime } from './runtime/browser.js'\nimport { genTableToSlides } from './gen/table/html-dom.js'\nimport type { TableToSlidesProps } from './types/index.js'\n\nexport class TsPptx extends PresentationCore {\n\tconstructor() {\n\t\tsuper(createBrowserRuntime())\n\t}\n\n\t/**\n\t * Reproduces a rendered HTML `<table>` as a PowerPoint table — including column widths,\n\t * style, etc. — creating one or more slides as needed. Resolves `eleId` against the global\n\t * `document`, so it exists only on the browser/standalone build; the same conversion is\n\t * available anywhere there is a DOM as the free `tableToSlides` on `ts-pptx/html`, which\n\t * also takes the element directly. The in-memory `slide.addTable(rows, opts)` path remains\n\t * the platform-agnostic way to build a table from data you already hold.\n\t * @param {string} eleId - table HTML element ID\n\t * @param {TableToSlidesProps} options - generation options\n\t */\n\ttableToSlides(eleId: string, options: TableToSlidesProps = {}): void {\n\t\t// @note `options.verbose` (a documented dev-only flag on TableToSlidesProps) is read\n\t\t// inside genTableToSlides to trace the auto-paging layout process.\n\t\tgenTableToSlides(this, eleId, options)\n\t}\n}\n\nexport { TsPptx as default }\nexport * from './enums.js'\nexport * from './units.js'\n// Use `export *` (not `export type *`) so the value exports `textRun`/`textRuns`\n// reach this entry; `export type *` would drop them and crash any consumer that\n// imports them, while TypeScript (reading index.d.ts) stays green.\nexport * from './types/index.js'\nexport { setDiagnosticHandler, type Diagnostic, type DiagnosticCode, type DiagnosticHandler } from './diagnostics.js'\n\n// Error taxonomy — every failure the library throws. The classes and their `code` are API;\n// the message is not. Re-exported from every entry so `instanceof` works whichever subpath a\n// consumer imports — they all resolve to one shared module, so the classes are identical.\nexport {\n\tTsPptxError,\n\tInvalidOptionError,\n\tUnsupportedFeatureError,\n\tPackageReadError,\n\tMediaError,\n\tInternalError,\n\ttype TsPptxErrorOptions,\n} from './errors.js'\nexport type {\n\tErrorCode,\n\tTsPptxCode,\n\tInvalidOptionErrorCode,\n\tUnsupportedFeatureErrorCode,\n\tPackageReadErrorCode,\n\tMediaErrorCode,\n\tInternalErrorCode,\n} from './codes.js'\n"],"mappings":";;;;;;;AAKA,SAAgB,uBAAuC;CACtD,OAAO;EACN,qBAAqB;EACrB;EACA;EACA;EACA;CACD;AACD;AAEA,eAAe,aAAa,QAAqC;CAChE,MAAM,WAAW,MAAM,MAAM,MAAM;CACnC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,WAAW,qBAAqB,gCAAgC,QAAQ;CACpG,OAAO,IAAI,WAAW,MAAM,SAAS,YAAY,CAAC;AACnD;AAEA,eAAe,UAAU,KAAwD;CAChF,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI;CACrC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,WAAW,sBAAsB,iCAAiC,IAAI,MAAM;CACxG,MAAM,OAAO,MAAM,SAAS,KAAK;CAEjC,OAAO,MAAM,IAAI,SAAiB,SAAS,WAAW;EACrD,MAAM,SAAS,IAAI,WAAW;EAC9B,OAAO,kBAAkB,QAAQ,OAAO,MAAgB;EACxD,OAAO,gBACN,OAAO,IAAI,WAAW,uBAAuB,sCAAsC,IAAI,MAAM,CAAC;EAC/F,OAAO,cAAc,IAAI;CAC1B,CAAC;AACF;AAEA,eAAe,oBAAoB,KAAqC;CACvE,OAAO,MAAM,IAAI,SAAS,SAAS,WAAW;EAC7C,MAAM,QAAQ,IAAI,MAAM;EACxB,MAAM,QAAQ,WAAqB;GAClC,IAAI,OAAO;GACX,OACC,IAAI,WACH,4BACA,yCAAyC,IAAI,OAAO,SAAS,MAAM,OAAO,MAAM,MAAM,IACvF,CACD;EACD;EAEA,MAAM,eAAe;GACpB,IAAI,MAAM,QAAQ,MAAM,WAAW,GAAG;IACrC,KAAK,OAAO;IACZ;GACD;GACA,MAAM,SAAS,SAAS,cAAc,QAAQ;GAC9C,MAAM,MAAM,OAAO,WAAW,IAAI;GAClC,IAAI,CAAC,KAAK;IACT,KAAK,+BAA+B;IACpC;GACD;GACA,OAAO,QAAQ,MAAM;GACrB,OAAO,SAAS,MAAM;GACtB,IAAI,UAAU,OAAO,GAAG,CAAC;GACzB,IAAI;IACH,IAAI,OAAO,OAAO,UAAU,IAAI,IAAI;IACpC,QAAQ,MAAM;GACf,SAAS,IAAI;IACZ,KAAK,EAAE;GACR;EACD;EACA,MAAM,gBAAgB,KAAK;EAC3B,MAAM,MAAM,OAAO,IAAI,SAAS,WAAW,IAAI,OAAO;CACvD,CAAC;AACF;AAEA,eAAe,UAAU,UAAkB,MAAiE;CAC3G,MAAM,UAAU,SAAS,cAAc,GAAG;CAC1C,QAAQ,aAAa,SAAS,eAAe;CAC7C,QAAQ,QAAQ,kBAAkB;CAClC,SAAS,KAAK,YAAY,OAAO;CAEjC,MAAM,MAAM,OAAO,IAAI,gBACtB,IAAI,KAAK,CAAC,IAAY,GAAG,EAAE,MAAM,4EAA4E,CAAC,CAC/G;CACA,QAAQ,OAAO;CACf,QAAQ,WAAW;CACnB,QAAQ,MAAM;CAEd,iBAAiB;EAChB,OAAO,IAAI,gBAAgB,GAAG;EAC9B,SAAS,KAAK,YAAY,OAAO;CAClC,GAAG,GAAG;CAEN,OAAO;AACR;;;ACxFA,IAAa,SAAb,cAA4B,iBAAiB;CAC5C,cAAc;EACb,MAAM,qBAAqB,CAAC;CAC7B;;;;;;;;;;;CAYA,cAAc,OAAe,UAA8B,CAAC,GAAS;EAGpE,iBAAiB,MAAM,OAAO,OAAO;CACtC;AACD"}
1
+ {"version":3,"file":"browser.js","names":[],"sources":["../src/runtime/browser.ts","../src/browser.ts"],"sourcesContent":["import { IMG_SVG_PLACEHOLDER } from '../constants-internal.js'\nimport { MediaError } from '../errors.js'\nimport type { SlideRelMedia } from '../types/internal.js'\nimport type { RuntimeAdapter } from './types.js'\n\nexport function createBrowserRuntime(): RuntimeAdapter {\n\treturn {\n\t\twriteFileOutputType: null,\n\t\tloadMedia,\n\t\tcreateSvgPngPreview,\n\t\twriteFile,\n\t\tloadFontData,\n\t}\n}\n\nasync function loadFontData(source: string): Promise<Uint8Array> {\n\tconst response = await fetch(source)\n\tif (!response.ok) throw new MediaError('font/fetch-failed', `Unable to load font (fetch): ${source}`)\n\treturn new Uint8Array(await response.arrayBuffer())\n}\n\nasync function loadMedia(rel: SlideRelMedia & { path: string }): Promise<string> {\n\tconst response = await fetch(rel.path)\n\tif (!response.ok) throw new MediaError('media/fetch-failed', `Unable to load image (fetch): ${rel.path}`)\n\tconst blob = await response.blob()\n\n\treturn await new Promise<string>((resolve, reject) => {\n\t\tconst reader = new FileReader()\n\t\treader.onloadend = () => resolve(reader.result as string)\n\t\treader.onerror = () =>\n\t\t\treject(new MediaError('media/decode-failed', `Unable to load image (FileReader): ${rel.path}`))\n\t\treader.readAsDataURL(blob)\n\t})\n}\n\nasync function createSvgPngPreview(rel: SlideRelMedia): Promise<string> {\n\treturn await new Promise((resolve, reject) => {\n\t\tconst image = new Image()\n\t\tconst fail = (reason?: unknown) => {\n\t\t\trel.data = IMG_SVG_PLACEHOLDER\n\t\t\treject(\n\t\t\t\tnew MediaError(\n\t\t\t\t\t'media/svg-preview-failed',\n\t\t\t\t\t`Unable to load image (image.onerror): ${rel.path}${reason ? ` - ${String(reason)}` : ''}`\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\n\t\timage.onload = () => {\n\t\t\tif (image.width + image.height === 0) {\n\t\t\t\tfail('h/w=0')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst canvas = document.createElement('CANVAS') as HTMLCanvasElement\n\t\t\tconst ctx = canvas.getContext('2d')\n\t\t\tif (!ctx) {\n\t\t\t\tfail('canvas 2d context unavailable')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcanvas.width = image.width\n\t\t\tcanvas.height = image.height\n\t\t\tctx.drawImage(image, 0, 0)\n\t\t\ttry {\n\t\t\t\trel.data = canvas.toDataURL(rel.type)\n\t\t\t\tresolve('done')\n\t\t\t} catch (ex) {\n\t\t\t\tfail(ex)\n\t\t\t}\n\t\t}\n\t\timage.onerror = () => fail()\n\t\timage.src = typeof rel.data === 'string' ? rel.data : IMG_SVG_PLACEHOLDER\n\t})\n}\n\nasync function writeFile(fileName: string, data: string | ArrayBuffer | Blob | Uint8Array): Promise<string> {\n\tconst eleLink = document.createElement('a')\n\teleLink.setAttribute('style', 'display:none;')\n\teleLink.dataset['interception'] = 'off'\n\tdocument.body.appendChild(eleLink)\n\n\tconst url = window.URL.createObjectURL(\n\t\tnew Blob([data as Blob], { type: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' })\n\t)\n\teleLink.href = url\n\teleLink.download = fileName\n\teleLink.click()\n\n\tsetTimeout(() => {\n\t\twindow.URL.revokeObjectURL(url)\n\t\tdocument.body.removeChild(eleLink)\n\t}, 100)\n\n\treturn fileName\n}\n","import PresentationCore from './presentation.js'\nimport { createBrowserRuntime } from './runtime/browser.js'\nimport { genTableToSlides } from './gen/table/html-dom.js'\nimport type { TableToSlidesProps } from './types/index.js'\n\n/**\n * The browser entry, reached through the `browser` export condition — a bundler resolving the\n * bare `@shbernal/ts-pptx` specifier for the web lands here without naming this subpath.\n *\n * Same authoring API as every other entry (see `entry-surface.ts`), plus one method that only\n * makes sense with a live DOM: {@link TsPptx.tableToSlides}. `writeFile` triggers a download\n * rather than touching a filesystem.\n */\nexport class TsPptx extends PresentationCore {\n\tconstructor() {\n\t\tsuper(createBrowserRuntime())\n\t}\n\n\t/**\n\t * Reproduces a rendered HTML `<table>` as a PowerPoint table — including column widths,\n\t * style, etc. — creating one or more slides as needed. Resolves `eleId` against the global\n\t * `document`, so it exists only on the browser/standalone build; the same conversion is\n\t * available anywhere there is a DOM as the free `tableToSlides` on `ts-pptx/html`, which\n\t * also takes the element directly. The in-memory `slide.addTable(rows, opts)` path remains\n\t * the platform-agnostic way to build a table from data you already hold.\n\t * @param {string} eleId - table HTML element ID\n\t * @param {TableToSlidesProps} options - generation options\n\t */\n\ttableToSlides(eleId: string, options: TableToSlidesProps = {}): void {\n\t\t// @note `options.verbose` (a documented dev-only flag on TableToSlidesProps) is read\n\t\t// inside genTableToSlides to trace the auto-paging layout process.\n\t\tgenTableToSlides(this, eleId, options)\n\t}\n}\n\nexport { TsPptx as default }\nexport * from './entry-surface.js'\n"],"mappings":";;;;;;;AAKA,SAAgB,uBAAuC;CACtD,OAAO;EACN,qBAAqB;EACrB;EACA;EACA;EACA;CACD;AACD;AAEA,eAAe,aAAa,QAAqC;CAChE,MAAM,WAAW,MAAM,MAAM,MAAM;CACnC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,WAAW,qBAAqB,gCAAgC,QAAQ;CACpG,OAAO,IAAI,WAAW,MAAM,SAAS,YAAY,CAAC;AACnD;AAEA,eAAe,UAAU,KAAwD;CAChF,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI;CACrC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,WAAW,sBAAsB,iCAAiC,IAAI,MAAM;CACxG,MAAM,OAAO,MAAM,SAAS,KAAK;CAEjC,OAAO,MAAM,IAAI,SAAiB,SAAS,WAAW;EACrD,MAAM,SAAS,IAAI,WAAW;EAC9B,OAAO,kBAAkB,QAAQ,OAAO,MAAgB;EACxD,OAAO,gBACN,OAAO,IAAI,WAAW,uBAAuB,sCAAsC,IAAI,MAAM,CAAC;EAC/F,OAAO,cAAc,IAAI;CAC1B,CAAC;AACF;AAEA,eAAe,oBAAoB,KAAqC;CACvE,OAAO,MAAM,IAAI,SAAS,SAAS,WAAW;EAC7C,MAAM,QAAQ,IAAI,MAAM;EACxB,MAAM,QAAQ,WAAqB;GAClC,IAAI,OAAO;GACX,OACC,IAAI,WACH,4BACA,yCAAyC,IAAI,OAAO,SAAS,MAAM,O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, s as ChartType, y as WRITE_OUTPUT_TYPE } from "./enums-D3aF4QGb.js";
2
- import { C as TableRow, H as BackgroundProps, Jt as OptsChartData, M as MediaProps, N as MediaType, S as TableProps, T as TableStyleProps, Tt as ChartOpts, a as Slide, an as SlideComment, b as TableCell, dn as TextMeasurement, en as MeasureTextOptions, et as Margin, f as SlideMasterProps, fn as TextProps, ft as HyperlinkProps, i as ObjectOptions, l as MasterTextStyleProps, o as SlideLayout, p as SlideNumberProps, rn as OverflowBoxOptions, rt as PositionProps, sn as TableLayoutResult, t as AddSlideProps, wt as ChartMulti } from "./slide-B6mDaM-P.js";
3
- import { 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 } from "./pres-5x1bjCzk.js";
1
+ import { f as SHAPE_NAME, h as SlideObjectType, i as CHART_NAME, s as ChartType, y as WRITE_OUTPUT_TYPE } from "./enums-oLLeaSW3.js";
2
+ import { C as TableCell, D as TableProps, F as MediaProps, G as BackgroundProps, I as MediaType, Mt as ChartOpts, O as TableRow, X as GeometryPoint, a as Slide, f as MasterTextStyleProps, fn as SlideComment, g as SlideNumberProps, h as SlideMasterProps, ht as HyperlinkProps, i as ObjectOptions, jt as ChartMulti, mn as TableLayoutResult, o as SlideLayout, ot as PositionProps, rt as Margin, sn as MeasureTextOptions, t as AddSlideProps, tn as OptsChartData, un as OverflowBoxOptions, vn as TextMeasurement, yn as TextProps } from "./slide-YuSCGa45.js";
3
+ import { 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 } from "./pres-2WsBGimU.js";
4
4
  import { a as ExtractedSlides, m as EmbeddedFontSlot } from "./presentation-types-BVw0EknS.js";
5
- import { c as DiagnosticCode } from "./errors-DRLpOpgQ.js";
5
+ import { c as DiagnosticCode } from "./errors-BENA-Xuw.js";
6
6
  //#region src/types/zoom.d.ts
7
7
  /** Options shared by all three zoom kinds. */
8
8
  interface ZoomBaseProps extends PositionProps {
@@ -105,6 +105,15 @@ interface SlideRelMedia {
105
105
  * separate, perfectly ordinary image rel.
106
106
  */
107
107
  oleRelType?: string;
108
+ /**
109
+ * Embedded 3D model part (`addModel3d`): the `.rels` `Type` URI to emit — the Microsoft
110
+ * `…/office/2017/06/relationships/model3d` type, which no `includes('image'|'audio'|'video')`
111
+ * sniff would ever reach. Present only on the `.glb` payload rel, where it takes precedence
112
+ * over the image/audio/video branch in `slideObjectRelationsToXml` and `type` carries the
113
+ * part's content type verbatim for `[Content_Types].xml`. The model's preview picture is a
114
+ * separate, perfectly ordinary image rel. Same escape hatch as {@link oleRelType}.
115
+ */
116
+ model3dRelType?: string;
108
117
  rId: number;
109
118
  /** Unescaped — see {@link SlideRel.Target}. Doubles as the zip entry name for embedded media. */
110
119
  Target: string;
@@ -127,6 +136,41 @@ interface SlideObject {
127
136
  _groupObjects?: SlideObject[];
128
137
  zoom?: ZoomInternal;
129
138
  ole?: OleInternal;
139
+ model3d?: Model3dInternal;
140
+ }
141
+ /**
142
+ * Resolved 3D-model payload carried on a {@link SlideObject} until `gen/slide/objects/model3d.ts`
143
+ * emits it. Camera values are already in `am3d`'s wire units so the emitter does no arithmetic:
144
+ * positions in 1/36,000,000ths of a metre, `fov` in 60000ths of a degree, and
145
+ * `meterPerModelUnitN` over a fixed denominator of 1,000,000.
146
+ */
147
+ interface Model3dInternal {
148
+ /** rId of the embedded `.glb` part rel (see {@link SlideRelMedia.model3dRelType}). */
149
+ modelRid: number;
150
+ /** rId of the preview picture's image rel — shared by `am3d:blip` and the `mc:Fallback` `p:pic`. */
151
+ previewRid: number;
152
+ /** `am3d:camera/am3d:pos` (`@x`/`@y`/`@z`). */
153
+ pos: {
154
+ x: number;
155
+ y: number;
156
+ z: number;
157
+ };
158
+ /** `am3d:camera/am3d:lookAt` (`@x`/`@y`/`@z`). */
159
+ lookAt: {
160
+ x: number;
161
+ y: number;
162
+ z: number;
163
+ };
164
+ /** `am3d:camera/am3d:up` (`@dx`/`@dy`/`@dz`). */
165
+ up: {
166
+ dx: number;
167
+ dy: number;
168
+ dz: number;
169
+ };
170
+ /** `am3d:perspective@fov`, in 60000ths of a degree. */
171
+ fov: number;
172
+ /** `am3d:meterPerModelUnit@n`; `@d` is always 1,000,000. */
173
+ meterPerModelUnitN: number;
130
174
  }
131
175
  /** Resolved OLE payload carried on a {@link SlideObject} until `gen/slide/objects/ole.ts` emits it. */
132
176
  interface OleInternal {
@@ -412,7 +456,6 @@ declare class PresentationCore {
412
456
  get sections(): SectionProps[];
413
457
  /** custom document properties stored in docProps/custom.xml */
414
458
  private _customProperties;
415
- private readonly _tableStyles;
416
459
  /**
417
460
  * slide layout definition objects, used for generating slide layout files.
418
461
  * `protected` (not `private`) so the browser entry subclass can resolve
@@ -634,24 +677,53 @@ declare class PresentationCore {
634
677
  * @param {SlideMasterProps} props - layout properties
635
678
  */
636
679
  defineSlideMaster(props: SlideMasterProps): void;
637
- /**
638
- * Register a reusable custom table style and return its GUID.
639
- * The style is written to `ppt/tableStyles.xml` and is editable in PowerPoint's
640
- * Table Styles gallery. Pass the returned GUID as `TableProps.tableStyle`, and use
641
- * the `has*` flags (`hasHeader`, `hasBandedRows`, …) to activate the matching regions.
642
- * @param {TableStyleProps} props - custom table style definition (requires `name`)
643
- * @returns {string} braced GUID to use as `tableStyle`
644
- * @example
645
- * const brand = pptx.defineTableStyle({
646
- * name: 'Brand Banded',
647
- * firstRow: { fill:'1A2B3C', color:'FFFFFF', bold:true },
648
- * band1H: { fill:'EAF1F8' },
649
- * })
650
- * slide.addTable(rows, { tableStyle: brand, hasHeader:true, hasBandedRows:true })
651
- */
652
- defineTableStyle(props: TableStyleProps): string;
653
680
  }
654
681
  //#endregion
682
+ //#region src/clip.d.ts
683
+ /**
684
+ * Which edge of the box is the half-disc's FLAT side; the arc bulges toward the opposite edge.
685
+ * `'right'` = flat right edge, arc bulging left.
686
+ */
687
+ type FlatSide = 'left' | 'right';
688
+ /**
689
+ * Which half-disc proportion to trace. Both are flat-on-one-edge, bulging half-discs whose arc
690
+ * reaches the opposite edge near mid-height; they differ only in how far the arc reaches.
691
+ * - `'deep'` — the arc spans about 32% of the box width, symmetric about mid-height (the default).
692
+ * - `'shallow'` — the arc spans about 13%, slightly asymmetric, with its apex just below mid-height.
693
+ */
694
+ type HalfDiscPreset = 'deep' | 'shallow';
695
+ /** A named clip silhouette, resolved to a `points` path by {@link clipPath}. */
696
+ type ClipShape =
697
+ /**
698
+ * A rectangle with one side replaced by an elliptical arc that bulges toward the opposite
699
+ * edge, reaching it near mid-height — the "D" a picture placeholder cuts on a cover slide.
700
+ */
701
+ {
702
+ kind: 'half-disc';
703
+ flat: FlatSide;
704
+ preset?: HalfDiscPreset;
705
+ };
706
+ /**
707
+ * Resolve a {@link ClipShape} to a freeform `points` path filling a `w × h` box, ready to hand
708
+ * to `addImage({ points })`.
709
+ *
710
+ * `w`/`h` are the image box's size **in inches** and must match the `w`/`h` the picture is drawn
711
+ * at — the path is emitted in the box's own coordinate space, not normalized (see the module
712
+ * note above).
713
+ * @param {ClipShape} shape - the named silhouette and its options
714
+ * @param {number} w - image box width (inches)
715
+ * @param {number} h - image box height (inches)
716
+ * @returns {GeometryPoint[]} the freeform path, for `addImage({ points })`
717
+ * @example
718
+ * const w = 5.22, h = 7.5
719
+ * slide.addImage({
720
+ * path: 'cover.jpg', x: 0, y: 0, w, h,
721
+ * points: clipPath({ kind: 'half-disc', flat: 'right' }, w, h),
722
+ * sizing: { type: 'cover' }, // center-crop the photo into the "D"
723
+ * })
724
+ */
725
+ declare function clipPath(shape: ClipShape, w: number, h: number): GeometryPoint[];
726
+ //#endregion
655
727
  //#region src/diagnostics.d.ts
656
728
  /** One diagnostic emitted by the library. */
657
729
  interface Diagnostic {
@@ -689,5 +761,5 @@ type DiagnosticHandler = (diagnostic: Diagnostic) => void;
689
761
  */
690
762
  declare function setDiagnosticHandler(next: DiagnosticHandler | null): void;
691
763
  //#endregion
692
- export { pixelsToEmu as C, SlideZoomProps as D, SectionZoomProps as E, SummaryZoomProps as O, percentToEmu as S, ptToHundredths as T, coordToEmu as _, ANGLE_UNITS_PER_DEGREE as a, emuToPoints as b, EMU_PER_POINT as c, HUNDREDTHS_PER_POINT as d, PERCENT_SCALE as f, StandardLayoutName as g, StandardLayout as h, PresentationCore as i, ZoomBaseProps as k, Emu as l, STANDARD_LAYOUTS as m, DiagnosticHandler as n, DEFAULT_PX_PER_INCH as o, POINTS_PER_INCH as p, setDiagnosticHandler as r, EMU_PER_INCH as s, Diagnostic as t, FIXED_PCT_PER_PERCENT as u, emuToInches as v, pointsToEmu as w, inchesToEmu as x, emuToPixels as y };
693
- //# sourceMappingURL=diagnostics-DzY9Tyfm.d.ts.map
764
+ export { SectionZoomProps as A, emuToPixels as C, pixelsToEmu as D, percentToEmu as E, SummaryZoomProps as M, ZoomBaseProps as N, pointsToEmu as O, emuToInches as S, inchesToEmu as T, POINTS_PER_INCH as _, FlatSide as a, StandardLayoutName as b, PresentationCore as c, EMU_PER_INCH as d, EMU_PER_POINT as f, PERCENT_SCALE as g, HUNDREDTHS_PER_POINT as h, ClipShape as i, SlideZoomProps as j, ptToHundredths as k, ANGLE_UNITS_PER_DEGREE as l, FIXED_PCT_PER_PERCENT as m, DiagnosticHandler as n, HalfDiscPreset as o, Emu as p, setDiagnosticHandler as r, clipPath as s, Diagnostic as t, DEFAULT_PX_PER_INCH as u, STANDARD_LAYOUTS as v, emuToPoints as w, coordToEmu as x, StandardLayout as y };
765
+ //# sourceMappingURL=diagnostics-BqBTmA3a.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-BqBTmA3a.d.ts","names":[],"sources":["../src/types/zoom.ts","../src/types/internal.ts","../src/runtime/types.ts","../src/units.ts","../src/presentation.ts","../src/clip.ts","../src/diagnostics.ts"],"mappings":";;;;;;;UAiBiB,sBAAsB;;EAEtC;;;;;EAKA;IAAe;IAAe;;;;;;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